BP_REST_Media_Details_Endpoint::bp_rest_get_total_media_count()

Return the total media count in your BP instance.

Description

Return

(int) Media count.

Source

File: bp-media/classes/class-bp-rest-media-details-endpoint.php

	public function bp_rest_get_total_media_count() {
		add_filter( 'bp_ajax_querystring', array( $this, 'bp_rest_media_object_results_media_all_scope' ), 20 );
		bp_has_media( bp_ajax_querystring( 'media' ) );
		remove_filter( 'bp_ajax_querystring', array( $this, 'bp_rest_media_object_results_media_all_scope' ), 20 );
		$count = $GLOBALS['media_template']->total_media_count;

		/**
		 * Filters the total number of media.
		 *
		 * @since 0.1.0
		 *
		 * @param int $count Total number of media.
		 */
		return apply_filters( 'bp_rest_get_total_media_count', (int) $count );
	}

Changelog

Changelog
Version Description
0.1.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.