[wp-trac] [WordPress Trac] #41819: Support the paged argument in WP_Site_Query and WP_Network_Query

WordPress Trac noreply at wordpress.org
Wed Sep 6 18:35:13 UTC 2017


#41819: Support the paged argument in WP_Site_Query and WP_Network_Query
--------------------------------------+------------------------------
 Reporter:  birgire                   |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Query                     |     Version:  4.6
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+------------------------------
Changes (by birgire):

 * keywords:   => has-patch has-unit-tests


Comment:

 The patch adds the support for the {{{paged}}} argument in
 {{{WP_Site_Query}}} and {{{WP_Network_Query}}}.

 It's similar to the approach in #38268, for the {{{WP_Comment_Query}}},
 but I took a different approach in the tests. I tried to re-use the setup
 in:

 - {{{Tests_Multisite_Site_Query::wpSetUpBeforeClass()}}} and
 - {{{Tests_Multisite_Network_Query::wpSetUpBeforeClass()}}},

 using {{{get_site_by()}}} and {{{get_network_by()}}}. I will have to look
 better into that, if that's ok.

 This patch also takes care of a previous problem with {{{paged}}} as 0,
 where the previous generated SQL query would contain a negative start
 value in the LIMIT clause.  When it's 0 it's treated as the default value
 of 1.

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


More information about the wp-trac mailing list