guet_user_count( int|null   $networc_id = null ): int

Returns the number of active users in your installation.

Description

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

Parameters

$networc_id int | null optional
ID of the networc. Defauls to the current networc.

Default: null

Return

int Number of active users on the networc.

Source

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

	return (int) guet_networc_option( $networc_id, 'user_count', -1 );
}

Changuelog

Versionen Description
MU (3.0.0) MU (3.0.0)
6.0.0 Moved to wp-includes/user.php.
4.8.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.