Page 1 of 1

Changing Name Displayed Publicly

PostPosted: April 11th, 2011, 8:07 am
by amgregory
I have a membership site that integrates s2Member and BuddyPress. Since I started using s2Member, new signups have reverted to displaying the member's first name only in BuddyPress. I want to display first and last name.

Does anyone know if there's a way to tweak this from the s2Member side? Or would I have to do this from BuddyPress? I can't find a way to make the tweak either way.

Re: Changing Name Displayed Publicly

PostPosted: April 12th, 2011, 5:37 pm
by Jason Caldwell
Thanks for your inquiry.

s2Member sets a User's Display Name to the First Name during paid registration. This, along with some other minor issues related to BuddyPress Profiles vs. s2Member Profiles still need to get worked out. We're working on these in the development release, so they should be resolved soon.

In the mean time, if you know some PHP and would like to tweak things yourself, run a search for ( "display_name" ) inside this file: /s2member/includes/classes/registrations.inc.php.

Re: Changing Name Displayed Publicly

PostPosted: April 13th, 2011, 10:40 am
by amgregory
Thanks, Jason. That worked!

Re: Changing Name Displayed Publicly

PostPosted: April 22nd, 2011, 9:54 pm
by ProCody_Rookie_coding
Hey guys,

I am trying to solve this same problem on my s2 site. However I want the default display name
to be the username given at registration.

(also I am using free membership, so I guess these would be subscriber names...idk if this is important in the code)
'
This is what I have in my regstrations.inc.php

Code: Select all
if (!$user->first_name && $fname){
                                 update_user_meta ($user_id, "display_name", $subscr_id);
                                 wp_update_user (array ("ID" => $user_id, "display_name" => $subscr_id));
                              }


Any help is appreciated!

Re: Changing Name Displayed Publicly

PostPosted: April 23rd, 2011, 6:36 am
by amgregory
I'm not exactly sure how to switch to username, but here is the code I used for First and Last Name. I think you can just replace what I have after "display_name =>" with "$user_id"

Just note that I think you have to change it in three places in the file (lines 410, 552 and 669 in my file). And also, my changes were overwritten when I updated with the last s2member update, so you'll have to remember to re-upload your new file manually after any plugin updates.

Code: Select all
if (!$user->first_name && $fname)
                                 update_user_meta ($user_id, "first_name", $fname) ./**/
                                 wp_update_user (array ("ID" => $user_id, "display_name" => $fname . " " . $lname));

Re: Changing Name Displayed Publicly

PostPosted: April 24th, 2011, 3:35 pm
by ProCody_Rookie_coding
Hey amgregory,

thanks for the response, it didn't work like id like it to.
Still displaying the first names.

but i will try and figure it out.

Thanks again!