bp_get_total_mention_count_for_user( int $user_id )
Return the total mention count for a specified user.
Description
Parameters
- $user_id
-
(Required) ID of user being queried. Default: displayed user ID.
Return
(int) The total mention count for the specified user.
Source
File: bp-activity/bp-activity-template.php
3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 | function bp_get_total_mention_count_for_user( $user_id = 0 ) { // Default to displayed user if none is passed. $user_id = empty ( $user_id ) ? bp_displayed_user_id() : $user_id ; // Get user meta if user ID exists. $retval = ! empty ( $user_id ) ? bp_get_user_meta( $user_id , 'bp_new_mention_count' , true ) : false; /** * Filters the total mention count for a user. * * @since BuddyPress 1.2.0 * @since BuddyPress 2.6.0 Added the `$user_id` parameter. * * @param int|bool $retval Total mention count for a user. False on no mentions. * @param int $user_id ID of the queried user. */ return apply_filters( 'bp_get_total_mention_count_for_user' , $retval , $user_id ); } |
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.