This topic has 13 replies, 3 voices, and was last updated 7 years by love2playgames.
-
Author
-
November 15, 2015 at 20:12 #87383niljeParticipant
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!
November 16, 2015 at 12:28 #87474niljeParticipantOr 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= smiththats all the user has to fill out
the username will then be: anna-smithis that possible?
November 16, 2015 at 18:27 #87579sharmstrModeratorThis 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 21, 2015 at 09:33 #88411niljeParticipanthi,
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-registrationthanks
November 21, 2015 at 15:01 #88441sharmstrModeratorDid 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 21, 2015 at 17:18 #88461niljeParticipantwow, 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 nameCOPY 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!!
November 21, 2015 at 17:25 #88462sharmstrModeratorPerhaps 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 21, 2015 at 17:59 #88466niljeParticipantOh 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.
November 21, 2015 at 18:03 #88467sharmstrModeratorYou’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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 21, 2015 at 20:43 #88472niljeParticipantHello 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 🙂
November 21, 2015 at 20:59 #88473niljeParticipantGOT IT!
this works
COPY CODEfunction 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' );
December 28, 2016 at 20:52 #148234love2playgamesParticipantHi 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,
December 28, 2016 at 21:07 #148235love2playgamesParticipantBtw, I even tried this BuddyPress Usernames Only plugin, it doesn’t work?
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.