[wp-trac] [WordPress Trac] #36675: WP_MS_Sites_List_Table should use WP_Site_Query

WordPress Trac noreply at wordpress.org
Mon May 30 17:12:59 UTC 2016


#36675: WP_MS_Sites_List_Table should use WP_Site_Query
----------------------------------------+------------------------
 Reporter:  spacedmonkey                |       Owner:
     Type:  task (blessed)              |      Status:  new
 Priority:  normal                      |   Milestone:  4.6
Component:  Networks and Sites          |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  multisite
----------------------------------------+------------------------

Comment (by DrewAPicture):

 On [attachment:36675.diff], setting of the 'order' value can probably be
 simplified since whitelisting is already handled in
 `WP_Site_Query::parse_order()`.

 Current:
 {{{#!php
 <?php
 if ( $order_by ) {
         $args['order'] = ( isset( $_REQUEST['order'] ) && 'DESC' ===
 strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
 }
 }}}

 Also I'm not actually sure why setting an order is dependent on an
 'orderby' in the first place since we already default to ordering by ids.

 Proposed:
 {{{#!php
 <?php
 if ( isset( $_REQUEST['order'] ) ) {
         $args['order'] = $_REQUEST['order'];
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36675#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list