bp_nouveau_object_template_results_members_tabs( $results,  $object )

Object template results members tabs.

Description

Source

File: bp-templates/bp-nouveau/includes/ajax.php

function bp_nouveau_object_template_results_members_tabs( $results, $object ) {
	if ( $object != 'members' ) {
		return $results;
	}

	$results['scopes'] = [];

	add_filter( 'bp_ajax_querystring', 'bp_nouveau_object_template_results_members_all_scope', 20 );
	bp_has_members( bp_ajax_querystring( 'members' ) );
	$results['scopes']['all'] = $GLOBALS["members_template"]->total_member_count;
	remove_filter( 'bp_ajax_querystring', 'bp_nouveau_object_template_results_members_all_scope', 20 );

	add_filter( 'bp_ajax_querystring', 'bp_nouveau_object_template_results_members_personal_scope', 20 );
	bp_has_members( bp_ajax_querystring( 'members' ) );
	$results['scopes']['personal'] = $GLOBALS["members_template"]->total_member_count;
	remove_filter( 'bp_ajax_querystring', 'bp_nouveau_object_template_results_members_personal_scope', 20 );

	if ( bp_is_active( 'activity' ) && bp_is_activity_follow_active() ) {
		$counts = bp_total_follow_counts();
		if ( ! empty( $counts['following'] ) ) {
			add_filter( 'bp_ajax_querystring', 'bp_nouveau_object_template_results_members_following_scope', 20 );
			bp_has_members( bp_ajax_querystring( 'members' ) );
			$results['scopes']['following'] = $GLOBALS["members_template"]->total_member_count;
			remove_filter( 'bp_ajax_querystring', 'bp_nouveau_object_template_results_members_following_scope', 20 );
		}
	}

	return $results;
}

Changelog

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