get_user_count()获取有效的用户总数

目录

描述

The number of active users in your installation.

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

get_user_count() 描述

用法

<?php get_user_count() ?>

get_user_count() 用法

参数

This function does not accept any parameters

get_user_count() 参数

示例

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
<?php
  $user_count = get_user_count();
  echo "There are currently $user_count users on this site.";
?>

get_user_count() 示例

历史

添加于 版本: 2.7

get_user_count() 历史

源文件

get_user_count() 函数的代码位于 wp-includes/ms-functions.php

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * The number of active users in your installation.
 *
 * The count is cached and updated twice daily. This is not a live count.
 *
 * @since MU 2.7
 *
 * @return int
 */
function get_user_count() {
	return get_site_option( 'user_count' );
}

get_user_count() 源文件

相关