Beispiel #1
0
 /**
  * @group bp_core_get_total_member_count
  * @group cache
  */
 public function test_bp_core_get_total_member_count_should_respect_cached_value_of_0()
 {
     global $wpdb;
     // set cached value to zero
     wp_cache_set('bp_total_member_count', 0, 'bp');
     $num_queries = $wpdb->num_queries;
     // run function
     bp_core_get_total_member_count();
     // check if function references cache or hits the DB by comparing query count
     $this->assertEquals($num_queries, $wpdb->num_queries);
 }
/**
 * Get the total site member count.
 *
 * @return int
 */
function bp_get_total_site_member_count()
{
    /**
     * Filters the total site member count.
     *
     * @since 1.2.0
     *
     * @param int $value Number-formatted total site member count.
     */
    return apply_filters('bp_get_total_site_member_count', bp_core_number_format(bp_core_get_total_member_count()));
}
function bp_get_total_site_member_count()
{
    return apply_filters('bp_get_total_site_member_count', bp_core_number_format(bp_core_get_total_member_count()));
}
function bp_get_total_member_count()
{
    return apply_filters('bp_get_total_member_count', bp_core_get_total_member_count());
}
/**
 * Return the total member count in your BP instance.
 *
 * Since BuddyPress 1.6, this function has used bp_core_get_active_member_count(),
 * which counts non-spam, non-deleted users who have last_activity.
 * This value will correctly match the total member count number used
 * for pagination on member directories.
 *
 * Before BuddyPress 1.6, this function used bp_core_get_total_member_count(),
 * which did not take into account last_activity, and thus often
 * resulted in higher counts than shown by member directory pagination.
 *
 * @return int Member count.
 */
function flat_sassy_boots_bp_get_total_member_count()
{
    return apply_filters('bp_get_total_member_count', bp_core_get_total_member_count());
}
<?php

global $sc_theme_globals, $wpdb;
$comments_count = wp_count_comments();
$approved_comments = $comments_count->approved;
$total_members = 0;
if (defined('BP_VERSION')) {
    $total_members = bp_core_get_total_member_count();
} else {
    $result = count_users();
    $total_members = $result['total_users'];
}
$count_posts = wp_count_posts('post');
$published_posts = $count_posts->publish;
$count_posts = wp_count_posts('recipe');
$published_recipes = $count_posts->publish;
$total_attachments = $wpdb->get_var($wpdb->prepare("SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = %s", 'attachment'));
$forum_stats = null;
if (function_exists('bbp_get_statistics')) {
    $forum_stats = bbp_get_statistics();
}
/*
                <!--content-->
                <section class="content full-width">
                    <div class="icons dynamic-numbers">
                        <header class="s-title">
                            <h2 class="ribbon large"><?php echo sprintf(__('%s en chiffres', 'socialchef'), get_bloginfo('name')); ?></h2>
                        </header>

                        <!--row-->
                        <div class="row">