bp_get_total_mention_count_for_user( int $user_id )

Return the total mention count for a specified user.


Description Description


Parameters Parameters

$user_id

(Required) ID of user being queried. Default: displayed user ID.


Top ↑

Return Return

(int) The total mention count for the specified user.


Top ↑

Source Source

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

	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 1.2.0
		 * @since 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 );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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