Registration and updating/create of METADATA data
-
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.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Registration and updating/create of METADATA data’ is closed to new replies.