BP_Media::total_user_group_media_count( int $user_id )

Count total groups media for the given user.

Description

Parameters

$user_id

(int) (Required)

Return

(array|bool|int)

Source

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

	public static function total_user_group_media_count( $user_id = 0 ) {
		global $bp, $wpdb;

		$privacy = bp_media_query_privacy( $user_id, 0, 'groups' );
		$privacy = "'" . implode( "', '", $privacy ) . "'";

		$total_count = (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->media->table_name} WHERE user_id = {$user_id} AND privacy IN ({$privacy})" );

		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.