bp_activity_get_comment_count( array|null $deprecated = null )

Return the comment count of an activity item.


Parameters Parameters

$deprecated

(array|null) (Optional) Deprecated.

Default value: null


Top ↑

Return Return

(int) $count The activity comment count.


Source Source

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

	function bp_activity_get_comment_count( $deprecated = null ) {
		global $activities_template;

		// Deprecated notice about $args.
		if ( ! empty( $deprecated ) ) {
			_deprecated_argument(
				__FUNCTION__,
				'1.2',
				sprintf(
					/* translators: 1: the name of the function. 2: the name of the file. */
					__( '%1$s no longer accepts arguments. See the inline documentation at %2$s for more details.', 'buddypress' ),
					__FUNCTION__,
					__FILE__
				)
			);
		}

		// Get the count using the purpose-built recursive function.
		$count = ! empty( $activities_template->activity->children )
			? bp_activity_recurse_comment_count( $activities_template->activity )
			: 0;

		/**
		 * Filters the activity comment count.
		 *
		 * @since 1.2.0
		 *
		 * @param int $count The activity comment count.
		 */
		return apply_filters( 'bp_activity_get_comment_count', (int) $count );
	}


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.