• Resolved cedricwalter

    (@cedricwalter)


    I have a user-registration form with a phone field.

    I’m using a custom snippet to access these user extra information.

    After a success user registration, I cant get access to the phone field. At least it does not show up in the logs…

    add_action( 'user_register', function ( $user_id ) {
        $all_meta_for_user = get_user_meta($user_id);
        error_log(print_r($all_meta_for_user,true));
    
        $user_meta = get_userdata($user_id);
        error_log(print_r($user_meta,true));
    }

    Is there any other event to use? how to access custom fields defined in user-registration? (i see user_login/user_email as these are standard wordpress fields but not mine)

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @cedricwalter,

    Thank you for writing in,

    Please try the following code for access user extra information,

    add_action( 'user_registration_after_register_user_action', 'ur_get_userdata_after_registration', 10, 3 );
    function ur_get_userdata_after_registration( $valid_form_data, $form_id, $user_id ) {
     error_log(print_r($valid_form_data,true));
     // you can do your task here.
    };

    Let me know if it helps or not and I will get back to you.

    Regards!

    Thread Starter cedricwalter

    (@cedricwalter)

    Thanks you it has work!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘custom hook accessing User Extra Information’ is closed to new replies.