WordPress.org

Make WordPress Core

Changeset 16160


Ignore:
Timestamp:
11/03/2010 01:34:04 PM (10 years ago)
Author:
ryan
Message:

Show latest x users with no paging if on a large network. see #15170

Location:
trunk
Files:
2 edited

Legend:

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

    r16128 r16160  
    3838            'blog_id' => 0
    3939        );
     40
     41        // If the network is large and a search is not being performed, show only the latest users with no paging in order
     42        // to avoid expensive count queries.
     43        if ( !$usersearch && ( get_blog_count() >= 10000 ) ) {
     44            if ( !isset($_REQUEST['orderby']) )
     45                $_GET['orderby'] = $_REQUEST['orderby'] = 'id';
     46            if ( !isset($_REQUEST['order']) )
     47                $_GET['order'] = $_REQUEST['order'] = 'DESC';
     48            $args['count_total'] = false;
     49        }
    4050
    4151        if ( isset( $_REQUEST['orderby'] ) )
  • trunk/wp-includes/user.php

    r16143 r16160  
    412412        if ( in_array( $qv['orderby'], array('email', 'url', 'registered') ) ) {
    413413            $orderby = 'user_' . $qv['orderby'];
    414         }
    415         elseif ( 'name' == $qv['orderby'] ) {
     414        } elseif ( 'name' == $qv['orderby'] ) {
    416415            $orderby = 'display_name';
    417         }
    418         elseif ( 'post_count' == $qv['orderby'] ) {
     416        } elseif ( 'post_count' == $qv['orderby'] ) {
    419417            $where = get_posts_by_author_sql('post');
    420418            $this->query_from .= " LEFT OUTER JOIN (
     
    426424            ";
    427425            $orderby = 'post_count';
    428         }
    429         else {
     426        } elseif ( 'id' == $qv['orderby'] ) {
     427            $orderby = 'ID';
     428        } else {
    430429            $orderby = 'user_login';
    431430        }
Note: See TracChangeset for help on using the changeset viewer.