Skip to:
Content

Ticket #8012: 8012.3.diff

File 8012.3.diff, 2.3 KB (added by johnjamesjacoby, 6 months ago)
  • src/bp-blogs/bp-blogs-functions.php

     
    129129                $sql['select'] = $wpdb->prepare( "SELECT blog_id, last_updated FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0 AND site_id = %d", $r['site_id'] );
    130130
    131131                // Omit root blog if large network
    132                 if ( wp_is_large_network( 'users' ) ) {
     132                if ( bp_is_large_install() ) {
    133133                        $sql['omit_root_blog'] = $wpdb->prepare( "AND blog_id != %d", bp_get_root_blog_id() );
    134134                }
    135135
  • src/bp-core/bp-core-functions.php

     
    39003900function bp_strip_script_and_style_tags( $string ) {
    39013901        return preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
    39023902}
     3903
     3904/**
     3905 * Is this a large BuddyPress installation?
     3906 *
     3907 * @since 4.1.0
     3908 *
     3909 * @return bool True if more than 10000 users, false not
     3910 */
     3911function bp_is_large_install() {
     3912
     3913        // Multisite has a function specifically for this
     3914        $retval = function_exists( 'wp_is_large_network' )
     3915                ? wp_is_large_network( 'users' )
     3916                : ( bp_core_get_total_member_count() > 10000 );
     3917
     3918        // Filter & return
     3919        return (bool) apply_filters( 'bp_is_large_install', $retval );
     3920}
  • src/bp-friends/bp-friends-functions.php

     
    781781        }
    782782
    783783        // Bail out if the site has a ton of users.
    784         if ( is_multisite() && wp_is_large_network( 'users' ) ) {
     784        if ( bp_is_large_install() ) {
    785785                return;
    786786        }
    787787
  • src/bp-groups/bp-groups-admin.php

     
    861861 * @param BP_Groups_Group $item The BP_Groups_Group object for the current group.
    862862 */
    863863function bp_groups_admin_edit_metabox_add_new_members( $item ) {
    864         if ( wp_is_large_network( 'users' ) ) {
     864        if ( bp_is_large_install() ) {
    865865                $class  = '';
    866866                $notice = __( 'Enter a comma-separated list of user logins.', 'buddypress' );
    867867        } else {
     
    12521252function bp_groups_admin_autocomplete_handler() {
    12531253
    12541254        // Bail if user user shouldn't be here, or is a large network.
    1255         if ( ! bp_current_user_can( 'bp_moderate' ) || ( is_multisite() && wp_is_large_network( 'users' ) ) ) {
     1255        if ( ! bp_current_user_can( 'bp_moderate' ) || bp_is_large_install() ) {
    12561256                wp_die( -1 );
    12571257        }
    12581258