• Is there anywhere I can find the code for a form that updates input fields to the usermeta table. I would like to put the form on a plugin admin page.

    thank you

Viewing 1 replies (of 1 total)
  • Joey

    (@leglesslizard)

    Hey,

    You should be able to create a plugin admin page using add_menu_page(), if you look at example 2 you can write your form in html on the callback function.

    When it comes to saving the data you may be able to hook in on “updated_option” and write a function that grabs the updated value and then saves it using update_user_meta(). This would mean you had the data saved as options in the database as well, however.

    Another approach would be to prevent the default behaviour of the “save” button on your custom page using javascript and use an ajax call to update the user meta.

    Hope that steers you in the right direction!

    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Form that updates to the usermeta table’ is closed to new replies.