Set meta value of custom user field programmatically

Support MB User Meta Set meta value of custom user field programmaticallyResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11289
    MauroMauro
    Participant

    Hello Anh,
    In order to update custom fields programmatically, you mention we can use update_post_meta but what about user meta fields? How can I update these programmatically?
    I am unable to the answer anywhere in the documentation.

    Thanks,
    Mauro.

    #11290
    MauroMauro
    Participant

    I'm trying with update_user_meta, seams the logic option 🙂

    #11305
    Anh TranAnh Tran
    Keymaster

    Hi Mauro,

    update_user_meta is the way to go. Glad that you found it!

    #40305
    AndreAndre
    Participant

    Is this still the way to go? I read in the documentation that there now is a helper function rwmb_set_meta( $user_id, $field_id, $value );. If I add it to the init action or not does make no difference. How is changing custom fields on the user supposed to work in the latest version?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.