• Creator
    Topic
  • #9607
    ingegnimultimediali
    Participant

    Hi,
    this new extension include as required fields in frontend registration form: username, email and double password fields.
    Is there the possibility to exclude these fields and leave only the meta-box fields in the frontend form?
    e.g. I would to create new user by frontend form, but username and password are generated by a hook after submit form

Viewing 3 replies - 11 through 13 (of 13 total)
  • Author
    Replies
  • #9961
    ingegnimultimediali
    Participant

    I'm sorry for last reply... the 2nd snippet is correct and it works fine

    using rwmb_profile_insert_user_data is it possible to return the

    $this->user_id = wp_insert_user( $data );??

    Know the user_id value will allow to do many other things

    #9962
    ingegnimultimediali
    Participant

    I solved by using user_register action

    add_action( 'user_register', 'test');

    function test( $user_id ) {

     add_user_meta( $user_id, 'user_field', 'field_value' );
    

    }

    #9966
    Anh Tran
    Keymaster

    Yes, your last snippet will work.

    I just wander why do you need to update a custom user meta? Doesn't it belong to a Meta Box? If it does, the Meta Box can handle all the saving. In case you want to add custom meta, beyond the scope of Meta Box, yes, it makes sense.

Viewing 3 replies - 11 through 13 (of 13 total)
  • The topic ‘required fields’ is closed to new replies.