bp_core_get_active_member_count()

返回成员总数,限于Last_actity的成员。

描述

返回

(int)活动成员的数量。

来源

文件:BP-Members / BP-Members-Functions.php

函数bp_core_get_active_member_count(){global $ wpdb;$ count = get_transient('bp_active_member_count');if(false === $ count){$ bp = buddypress();//通过拆分查找来避免昂贵的连接。if(is_multisite()){$ sql =“从{$ wpdb->用户选择ID,其中(user_status!= 0或删除!= 0或user_status!= 0)”;}否则{$ sql =“从{$ wpdb->用户选择ID,其中user_status!= 0”;$ fallude_users = $ wpdb-> get_col($ sql);$ complude_users_sql =!空($ callude_users)?“和user_id不在(”。inclode(',',wp_parse_id_list($ callude_users))。“)”:'';$ count =(int)$ wpdb-> get_var($ wpdb->准备(“选择count(user_id)从{$ bp->成员 - > table_name_last_activity},其中component =%s和type ='last_activity'{$ complude_users_sql}“,$ BP->会员 - > ID)); set_transient( 'bp_active_member_count', $count ); } /** * Filters the total number of members for the installation limited to those with last_activity. * * @since BuddyPress 1.6.0 * * @param int $count Total number of active members. */ return apply_filters( 'bp_core_get_active_member_count', $count ); }

变更乐

变更乐
版本 描述
Buddypress 1.6.0. 介绍。

问题?

我们总是很乐意帮助您可能拥有的代码或其他问题!搜索我们开发人员文档联系支持,或与我们联系销售团队