Support

Account

Home Forums General Issues Saving fields to user registration form Reply To: Saving fields to user registration form

  • Hi @bowersinit

    When an input has a name value like fields[field_55e57136adc2e] the $_POST value will actually be an array called fields with a fieldkey of field_55e57136adc2e which in term contains the value.

    So try this out:

    
    function save_additional_user_meta( $user_id ) {
    
        if ( isset( $_POST['fields']['field_55e57136adc2e'] ) )
            update_user_meta($user_id, 'number_of_bedrooms', $_POST['fields']['field_55e57136adc2e']);
    }
    add_action( 'user_register', 'save_additional_user_meta', 10, 1 );