bp_get_total_online_member_count()

Get total number of members currently online.

Description

Source

File: bp-members/classes/class-bp-core-whos-online-widget.php

	function bp_get_total_online_member_count() {

		global $members_template;

		$total = 0;

		$members_args = array(
			'user_id'         => 0,
			'type'            => 'online',
			'max'             => 999,
			'populate_extras' => false,
			'search_terms'    => false,
		);

		$old_members_template = $members_template;
		if ( bp_has_members( $members_args ) ){
			$total = $members_template->total_member_count;
		}
		$members_template = $old_members_template;
		return $total;
	}

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.