WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get user count

Description

The number of active users in your installation.

The count is cached and updated twice daily. This is not a live count.

Usage

<?php get_user_count() ?>

Parameters

This function does not accept any parameters

Return values

(integer) 
The number of active users

Examples

The call to get_user_count<tt> returns the number of active users in a site installation. <?php
  $user_count 
get_user_count();
  echo 
"There are currently $user_count users on this site.";
?>

Result

The result of the above example.

There are currently 123 users on this site.

Notes

Change Log

Since: 2.7

Source File

<tt>get_user_count() is located in wp-includes/ms-functions.php

Related

 

See also index of Function Reference and index of Template Tags.
This page is marked as incomplete. You can help Codex by expanding it.