wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



get_user_count › WordPress Function

Seit
Veraltetn/v
get_user_count ( $network_id = null )
Parameter:
  • (int|null) $network_id ID of the network. Defaults to the current network.
    Erforderlich: Nein
    Standard: null
Gibt zurück:
  • (int) Number of active users on the network.
Definiert in:
Codex:
Changelog:
  • 4.8.0
  • 6.0.0

Returns the number of active users in your installation.

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


Quellcode

function get_user_count( $network_id = null ) {
	if ( ! is_multisite() && null !== $network_id ) {
		_doing_it_wrong(
			__FUNCTION__,
			sprintf(
				/* translators: %s: $network_id */
				__( 'Unable to pass %s if not using multisite.' ),
				'<code>$network_id</code>'
			),
			'6.0.0'
		);
	}

	return (int) get_network_option( $network_id, 'user_count', -1 );
}