Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Xprofile: Just show first Letter of last name


Burt Adsit
Participant

@burtadsit

This seems to work for everything except site wide activity:

function my_fullname_filter($name){

$name_a = explode(\’ \’, $name);

// if there is at least two parts to the name

if (count($name_a) == 2){

// replace the last part of the name with the first letter of the last part

$name_a[count($name_a)-1] = substr($name_a[count($name_a)-1], 0, 1);

// put it all back together

$name = implode(\’ \’, $name_a);

}

return $name;

}

add_filter(\’bp_fetch_user_fullname\’,\’my_fullname_filter\’);

The activity displays store the user\’s profile link in the activity table pre-generated and there is no opportunity to filter things that already exist there. You\’ll either have to wipe the activity tables or just wait till they filter out. New activity will have the filtered full name.

Skip to toolbar