This topic has 13 replies, 3 voices, and was last updated 7 years by love2playgames.

  • Author
  • #87383
     nilje
    Participant

    Hello

    In the registration form you can set the username, but not the pre- and surname. But that would be more important in my case.

    Can I change that somehow?

    Thanks!

    #87474
     nilje
    Participant

    Or maybe sync the username with the name? So it wouldn’t be a problem with the login?

    so for example:
    at the register there is
    prename= anna
    surname= smith

    thats all the user has to fill out
    the username will then be: anna-smith

    is that possible?

    #87579
     sharmstr
    Moderator

    This has been discussed on the buddypress forum many times. Search there.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #87603
     nilje
    Participant

    I haven’t found anything about that…

    #88411
     nilje
    Participant

    hi,
    so I really don’t find anything about it.

    I would like to consider custom work for that, could you do that?

    I already wrote it down, but I think it was the wrong forum.
    https://archived.seventhqueen.com/forums/topic/first-and-last-name-in-registration

    thanks

    #88441
     sharmstr
    Moderator

    Did you try this? https://buddypress.org/support/topic/how-to-use-custom-name-fields-with-xprofile/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #88461
     nilje
    Participant

    wow, that was easy. Really sorry, haven’t found this.

    what I just don’t get to work is the display name. So I have first and last name, but how will it take this for display name?
    here is a line to modify it, but it will always show the username, not the name which is set of first and last name

    COPY CODE
    //you can modify that line to change the displayed name to something else than the nickname
    	$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $nickname, $user_id ) );

    I tried that:

    COPY CODE
    //you can modify that line to change the displayed name to something else than the nickname
    	$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $firstname, $lastname, $user_id ) );

    thank you!!

    #88462
     sharmstr
    Moderator

    Perhaps you should ask the person who posted it 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #88466
     nilje
    Participant

    Oh my 😀 sorry, I’m used to see just topics which are closed already, so I didn’t login the first time.
    I’m not that annoying as it seems right now 😀

    Thank you very very much! You saved my day.

    #88467
     sharmstr
    Moderator

    You’re not annoying. You’re welcome.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #88472
     nilje
    Participant

    Hello again,

    I’m searching a while now for the display issue and would like you to ask, if Kleo sets the default display name anywhere?
    I can change the display name on the users’ profile at the backend manually, but it should do it right away.

    I found many codes which would change the default display name from username to first and last name, but nothing works.

    Do you have any idea why it wouldn’t change the default?

    Thanks 🙂

    #88473
     nilje
    Participant

    GOT IT!

    this works

    COPY CODE
    function set_default_display_name( $user_id ) {
      $user = get_userdata( $user_id );
      $name = sprintf( '%s %s', $user->first_name, $user->last_name );
      $args = array(
        'ID' => $user_id,
        'display_name' => $name,
        'nickname' => $name
      );
      wp_update_user( $args );
    }
    add_action( 'user_register', 'set_default_display_name' );
    #148234
     love2playgames
    Participant

    Hi 7Queen,

    Vise Versa, I want to show their username instead (Globally), can you tell me how to do this using some kind of function?

    The user now shown as example: JOHN HUDSON , although is just a nickname/alias of their first and name.

    But I want the users to shown their username as example: SUGARBABY or @SUGARBABY

    Please advise help,

    #148235
     love2playgames
    Participant

    Btw, I even tried this BuddyPress Usernames Only plugin, it doesn’t work?

Viewing 14 posts - 1 through 14 (of 14 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?