• Resolved hardsoft98

    (@hardsoft98)


    Hello everyone.

    I have a question about how to pass the data to metadata, when I am registering in a form. I wrote an example with the “direccionnro1” field assigning the value of “tttt” but with either the update_user_meta or add_user_meta function, it is not reflected in the metadata table.

    Example code:

    function my_user_register( $user_id ) {
    
    $user_data = get_userdata ( $user_id ) ;
    error_log( var_export( $user_data, 1 ) );
    
    $user_meta = get_user_meta ( $user_id ) ;
    error_log( var_export( $user_meta, 1 ) );
    
    $nro_socio = $user_meta['nrosocio'][0] ;
    error_log( var_export( $user_meta, 1 ) );
    
    $email = $user_data->user_email;
    error_log( var_export( $user_meta, 1 ) );
    
    update_user_meta( $user_id, 'direccion', $nro_socio );
    update_user_meta( $user_id, 'direccionnro', $email );
    update_user_meta( $user_id, 'direccion1', 'xxxxx' );
    update_user_meta( $user_id, 'direccionnro1', 'tttt' );
    add_user_meta ( $user_id, 'direccionnro1', 'tttt', true );
    
    $user_meta = get_user_meta ( $user_id ) ;
    error_log( var_export( $user_meta, 1 ) );
    
    }
    add_action( 'um_user_register', 'my_user_register', 10, 1 );

    what am I doing wrong? Can somebody help me
    Thank you.

    • This topic was modified 11 months ago by hardsoft98.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support andrewshu

    (@andrewshu)

    Hello @hardsoft98

    Try to use the “um_registration_complete” hook.

    Regards.

    Plugin Support andrewshu

    (@andrewshu)

    Hi @hardsoft98

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Registration and updating/create of METADATA data’ is closed to new replies.