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.
Then 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.