BP_Document::total_group_document_count( int $group_id )

Count total document for the given group.

Description

Parameters

$group_id

(int) (Required)

Return

(array|bool|int)

Source

File: bp-document/classes/class-bp-document.php

	public static function total_group_document_count( $group_id = 0 ) {
		global $bp, $wpdb;

		$total_count_document = (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->document->table_name} WHERE group_id = {$group_id} AND folder_id = 0" );       // db call ok; no-cache ok;
		$total_count_folder   = (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->document->table_name_folder} WHERE group_id = {$group_id} AND parent = 0" ); // db call ok; no-cache ok;
		$total_count          = $total_count_folder + $total_count_document;

		return $total_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.