bp_get_mentioned_user_display_name( int|string|bool $user_id_or_username = false )
Returns the mentioned user display name.
Description
Parameters
- $user_id_or_username
-
(Optional) User ID or username.
Default value: false
Return
(string) The mentioned user's display name.
Source
File: bp-activity/bp-activity-template.php
function bp_get_mentioned_user_display_name( $user_id_or_username = false ) { // Get user display name. $name = bp_core_get_user_displayname( $user_id_or_username ); // If user somehow has no name, return this really lame string. if ( empty( $name ) ) { $name = __( 'a user', 'buddyboss' ); } /** * Filters the mentioned user display name. * * @since BuddyPress 1.2.0 * * @param string $name Display name for the mentioned user. * @param int|string $user_id_or_username User ID or username use for query. */ return apply_filters( 'bp_get_mentioned_user_display_name', $name, $user_id_or_username ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.2.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.