I created a custom admin page in Wordpress and it works as it should. I also figured out how to save things, and have it displayed on the website.
What I just can't figure out is to save the changes to my custom admin page for that specific user.
Said in another way, you have to, for example, enter your phone number in an input field, where this phone number should appear on the website. I can do that part myself, but when other users access my custom admin page, they have to enter their own and not what another user has entered.
I created a custom admin page in Wordpress and it works as it should. I also figured out how to save things, and have it displayed on the website.
What I just can't figure out is to save the changes to my custom admin page for that specific user.
Said in another way, you have to, for example, enter your phone number in an input field, where this phone number should appear on the website. I can do that part myself, but when other users access my custom admin page, they have to enter their own and not what another user has entered.
Share Improve this question edited Aug 11, 2019 at 12:00 Matthew Brown aka Lord Matt 1,0683 gold badges13 silver badges34 bronze badges asked Aug 10, 2019 at 17:40 Oscar S.Oscar S. 191 gold badge1 silver badge3 bronze badges 1- do you mean that you have multiple admin, so you need each one has his own options – Makiomar Commented Aug 10, 2019 at 18:42
1 Answer
Reset to default 2Then save the data in the usermeta table, linked to each user, by update_user_meta()
and get_user_meta()
functions. get_current_user_id()
gives you the $user_id to pass. Choose a $meta_key that wion't create conflict, preferrably with a unique prefix. Same rule as for keys for saving data in options table.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745251065a4618679.html
评论列表(0条)