Make WordPress Core


Ignore:
Timestamp:
10/03/2011 04:30:07 PM (14 years ago)
Author:
ryan
Message:

Consolidate larg network criteria into wp_is_large_network(). Allow plugins to change this criteria via filter. Props PeteMall. fixes #18464

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r18562 r18871  
    3838        $like_s = esc_sql( like_escape( $s ) );
    3939
    40         $large_network = false;
    4140        // If the network is large and a search is not being performed, show only the latest blogs with no paging in order
    4241        // to avoid expensive count queries.
    43         if ( !$s && ( get_blog_count() >= 10000 ) ) {
     42        if ( !$s && wp_is_large_network() ) {
    4443            if ( !isset($_REQUEST['orderby']) )
    4544                $_GET['orderby'] = $_REQUEST['orderby'] = '';
    4645            if ( !isset($_REQUEST['order']) )
    4746                $_GET['order'] = $_REQUEST['order'] = 'DESC';
    48             $large_network = true;
    4947        }
    5048
     
    105103
    106104        // Don't do an unbounded count on large networks
    107         if ( ! $large_network )
     105        if ( ! wp_is_large_network() )
    108106            $total = $wpdb->get_var( str_replace( 'SELECT *', 'SELECT COUNT( blog_id )', $query ) );
    109107
     
    111109        $this->items = $wpdb->get_results( $query, ARRAY_A );
    112110
    113         if ( $large_network )
     111        if ( wp_is_large_network() )
    114112            $total = count($this->items);
    115113
Note: See TracChangeset for help on using the changeset viewer.