Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disabling user nickname changes, problem when registering.

  • Avatar of Eomera119
    Eomera119
    Participant

    @eomera119

    Hello, I have manged to stop users from chaning their nicknames on the BP profile by adding this code to bp custom.

    // No name changes Man
    
    function disable_name_change( $data ) {
    if ( 1 == $data->field_id )
    $data->field_id = false;
    return $data;
    }
    add_action( 'xprofile_data_before_save', 'disable_name_change' );
    
    // No name changes Man over

    The problem is that now when a user registers the nickname is not saved in the DB, only username is, so the code above it’s stopping users from even setting their first nickname, not only changing it, any solutions?

You must be logged in to reply to this topic.