• Resolved wptechnology

    (@wptechnology)


    I’d like to know what is the PHP function to use to save values into fields that can be retrieve by using um_user(‘nameOfField’); ?
    I was thinking of update_user_meta() but this is not that. Value saved there seems to be only retrievable through get_user_meta().
    Any help ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wptechnology

    (@wptechnology)

    Answering to myself for people who will need this information:

    If you’ve created (or want to create) a profile value to be saved & retrieved using um_user(‘name_of_field’); you can save it like this :

    
    
    global $ultimatemember;
    $user_id = um_user('ID');
        
    um_fetch_user($user_id);
    $toupdate[] = array('name_of_field' => 'its_value');
    UM()->user()->update_profile($toupdate);
    
    
    Thread Starter wptechnology

    (@wptechnology)

    Well in fact it seems that you also need to save the value in user_meta too,
    so you need to add also this line :

    
    update_user_meta($user_id, 'name_of_field','its_value');
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘What is the PHP function to save fields in um_user?’ is closed to new replies.