get_user_count( int|null $network_id = null )

Returns the number of active users in your installation.


Description

Note that on a large site the count may be cached and only updated twice daily.


Parameters

$network_id

(Optional) ID of the network. Defaults to the current network.

Default value: null


Return

(int) Number of active users on the network.


Source

File: wp-includes/user.php

function get_user_count( $network_id = null ) {
	return get_network_option( $network_id, 'user_count' );
}


Changelog

Changelog
Version Description
6.0.0 Moved to wp-includes/user.php.
4.8.0 The $network_id parameter has been added.
MU (3.0.0) Introduced. MU (3.0.0)