WordPress.org

Ready to get started?Download WordPress

Forums

update_user_meta not working (5 posts)

  1. vilhjalmurv
    Member
    Posted 2 years ago #

    Hi, I'm having a problem with update_user_meta. I am trying to add custom fields to user profiles, I get the fields to display in profile.php, but everytime I try to save the data using update_user_meta it wont save. For most of the users the meta key doesn't exist, so update_user_meta should create it, but it doesn't...

    Can anyone spot my mistake?

    http://pastebin.com/tBRt11fc

  2. NateJacobs
    Member
    Posted 2 years ago #

    I spotted two things. First, you are missing the call to global $nff_custom_fields; in your nffpc_save_custom_profile_field function so the variable is undefined. Second, on line 58 and 59 your callback functions have an 's' on the end, but your function name on line 44 does not.

  3. vilhjalmurv
    Member
    Posted 2 years ago #

    Thanks, I tryed that, but not working so far :(

  4. vilhjalmurv
    Member
    Posted 2 years ago #

    Got it to work with your help, just forgot that i changed update_user_meta to update_user_option when I was troubleshooting.

  5. NateJacobs
    Member
    Posted 2 years ago #

    Awesome. Glad to hear.

Topic Closed

This topic has been closed to new replies.

About this Topic