Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to use full name, first name + last name


peterverkooijen
Participant

@peterverkooijen

Why don’t you just add two additional profile fields (last name & first name) , make them required so they show up on registration and then write a custom function to tweak the sign up email?

Yes, that’s what I want to do. But how would that work?

I’d already tried editing wpmu-functions.php, replace ‘Dear User’ with ‘Dear DISPLAYNAME’ and then add this line:

\’$welcome_email = str_replace( “DISPLAYNAME”, $user->display_name, $welcome_email );\’

But the display_name field in wp_users has the username, not the full name. Full name and other profile fields are in wp_bp_xprofile_fields + wp_bp_xprofile_data. I have no clue how to get them from there.

Is it possible to write a function to retrieve full name (or first + last) from wp_bp_xprofile_data and put the result in the email? How does that work? Can you point me to a code example that shows the basic principles?

Skip to toolbar