Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: BP Member profile shows name as @rich_r..not correct Title name

@danbp

Participant

The function used to show @ mention is bp_displayed_user_mentionname in this template context:

<h2 class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></h2>

Above the profile header you have the fullname, which use this function: bp_displayed_user_fullname.

To replace the mention by the fullname, you can use this snippet (goes to bp-custom.php):

function bpfr_user_fullname() {
        // uncomment below if you want this only for logged in users.
	//if ( !is_user_logged_in() )
		//return false;

	echo bp_displayed_user_fullname();
	
}
add_filter( 'bp_get_displayed_user_mentionname', 'bpfr_user_fullname' );

To remove the existing fullname, you use something like:

function bpfr_remove_fullname_from_profile() {	
global $bp;
	
	if ( bp_is_active( 'xprofile' ) )

	if( bp_is_user() && ! bp_get_member_user_id() ) {
        $user_id = 'displayed: '. bp_displayed_user_id();
    } else {
        $user_id = 'get_member_user: '. bp_get_member_user_id();
    }

	remove_filter( 'bp_displayed_user_fullname', isset( $bp->displayed_user->fullname ) ? $bp->displayed_user->fullname : '' );
	
}
add_filter( 'bp_displayed_user_fullname', 'bpfr_remove_fullname_from_profile' );

And in case of you want to modify the @ sign, it is hardcoded in the template. You have to remove it manually via a child-theme.

Many other related topics on the forum.

Function reference.

Skip to toolbar