get_user_count() - WordPress 函数参考中文文档

返回介绍

get_user_count()

发布于 2017-09-11 字数2364 浏览 970 评论 0

get_user_count( int|null $network_id = null )

The number of active users in your installation.


描述

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


参数

$network_id

(int|null)
(Optional)
ID of the network. Default is the current network.

Default value: null


返回值

(int) Number of active users on the network.


源代码

File: wp-includes/ms-functions.php

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

更新日志

Version 描述
MU 2.7 MU 2.7
4.8.0 Introduced.

相关函数

Uses

  • wp-includes/option.php:
    get_network_option()

Used By

  • wp-admin/includes/class-wp-ms-users-list-table.php:
    WP_MS_Users_List_Table::get_views()
  • wp-admin/includes/dashboard.php:
    wp_network_dashboard_right_now()
  • wp-includes/update.php:
    wp_version_check()
  • wp-includes/ms-functions.php:
    wp_is_large_network()
  • wp-includes/ms-functions.php:
    get_sitestats()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Rami Yushuvaev

    
    printf(
    	/* translators: %s: User count */
    	__( 'There are currently %s users on this site.', 'text-domain' ),
    	get_user_count()
    );
    
  2. Get number of active users

    $user_count = get_user_count();
    echo "There are currently $user_count users on this site.";
    

上一篇:get_user_by_email()

下一篇:get_user_details()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!