bp_activity_get_user_mentionname( int|string $user_id )

Determine a user’s “mentionname”, the name used for that user in @-mentions.


Parameters Parameters

$user_id

(int|string) (Required) ID of the user to get @-mention name for.


Top ↑

Return Return

(string) $mentionname User name appropriate for @-mentions.


Source Source

File: bp-activity/bp-activity-functions.php

function bp_activity_get_user_mentionname( $user_id ) {
	$mentionname = '';

	$userdata = bp_core_get_core_userdata( $user_id );

	if ( $userdata ) {
		if ( bp_is_username_compatibility_mode() ) {
			$mentionname = str_replace( ' ', '-', $userdata->user_login );
		} else {
			$mentionname = $userdata->user_nicename;
		}
	}

	return $mentionname;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.