bp_document_get_total_group_document_count( int $group_id )

Get the document count of a given group.

Description

Parameters

$group_id

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

Return

(int) document count of the group.

Source

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

831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
function bp_document_get_total_group_document_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_document_for_group_' . $group_id, 'bp' );
 
    if ( false === $count ) {
        $count = BP_Document::total_group_document_count( $group_id );
        wp_cache_set( 'bp_total_document_for_group_' . $group_id, $count, 'bp' );
    }
 
    /**
     * Filters the total document count for a given group.
     *
     * @param int $count Total document count for a given group.
     *
     * @since BuddyBoss 1.4.0
     */
    return apply_filters( 'bp_document_get_total_group_document_count', (int) $count );
}

Changelog

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