bp_media_get_total_group_album_count( int $group_id )

Get the album count of a given group.

Description

Parameters

$group_id

(Required) ID of the group whose album are being counted.

Return

(int) album count of the group.

Source

File: bp-media/bp-media-functions.php

function bp_media_get_total_group_album_count( $group_id = 0 ) {
	if ( empty( $group_id ) && bp_get_current_group_id() ) {
		$group_id = bp_get_current_group_id();
	}

	$count = wp_cache_get( 'bp_total_album_for_group_' . $group_id, 'bp' );

	if ( false === $count ) {
		$count = BP_Media_Album::total_group_album_count( $group_id );
		wp_cache_set( 'bp_total_album_for_group_' . $group_id, $count, 'bp' );
	}

	/**
	 * Filters the total album count for a given group.
	 *
	 * @since BuddyBoss 1.2.0
	 *
	 * @param int $count Total album count for a given group.
	 */
	return apply_filters( 'bp_media_get_total_group_album_count', (int) $count );
}

Changelog

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