Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/13/2012 04:31:51 PM (14 years ago)
Author:
boonebgorges
Message:

'Total member count' cleanup:

  • Introduces bp_core_get_active_member_count() to get an accurate count of members with recorded last_activity
  • Points bp_get_total_member_count() to bp_core_get_active_member_count(), so that 'All Members' tab count on member directories matches the total count prepared by BP_Core_User::get_users(). Fixes #4061
  • Changes 'All Members' count in activity/index.php to use bp_get_total_member_count(), for greater accuracy and consistency between activity and members components
  • Introduces a cache-busting function to be fired when member counts change (new members, spam status changed, member deleted)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template.php

    r5942 r5987  
    503503add_filter( 'bp_create_excerpt', 'force_balance_tags' );
    504504
     505/**
     506 * Echoes the output of bp_get_total_member_count()
     507 */
    505508function bp_total_member_count() {
    506509        echo bp_get_total_member_count();
    507510}
     511        /**
     512         * Returns the total member count in your BP instance
     513         *
     514         * Since BuddyPress 1.6, this function has used bp_core_get_active_member_count(), which
     515         * counts non-spam, non-deleted users who have last_activity. This value will correctly
     516         * match the total member count number used for pagination on member directories.
     517         *
     518         * Before BuddyPress 1.6, this function used bp_core_get_total_member_count(), which did
     519         * not take into account last_activity, and thus often resulted in higher counts than
     520         * shown by member directory pagination.
     521         */
    508522        function bp_get_total_member_count() {
    509                 return apply_filters( 'bp_get_total_member_count', bp_core_get_total_member_count() );
     523                return apply_filters( 'bp_get_total_member_count', bp_core_get_active_member_count() );
    510524        }
    511525        add_filter( 'bp_get_total_member_count', 'bp_core_number_format' );
Note: See TracChangeset for help on using the changeset viewer.