Skip to:
Content
Pages
Categories
Search
Top
Bottom

register page problem


  • Masoud
    Participant

    @masoud1111

    hi.
    i made an extra field on buddypress registration form.

    <tr>
    <th><label for="person_relation">Inviter's Name</label></th>
    <td>
    <input type="text" name="person_relation" id="person_relation" value="<?php echo esc_attr( get_the_author_meta( 'person_relation', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description">Please enter your inviter's name.</span>
    </td>
    </tr>

    but when the user click “complete sign up”
    that field is emtpy!
    i dont know how to send user data to that specific user_meta i’ve created.
    any suggestions on how can i send the data please?

    tnx a lottt.

Viewing 1 replies (of 1 total)

  • Masoud
    Participant

    @masoud1111

    solved it.
    hopefully someone from wordpres.org helped me.
    here is the link for anyone in the future faced the same problem as me.
    wordpress.org page

    the answer was:
    If you want to add some user meta info in user database while registration you need to use “user_register” filter like below code:Add code in your themes function.php file

    add_action( 'user_register', 'my_user_meta_save', 10, 1 );
    function my_user_meta_save( $user_id ) {
        if ( isset( $_POST['first_name'] ) )
            update_user_meta($user_id, 'first_name', $_POST['first_name']);
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar