[wp-trac] [WordPress Trac] #18897: query_posts / WP_query parameter 'offset' should play nicely with 'paged'

WordPress Trac wp-trac at lists.automattic.com
Wed May 2 15:48:57 UTC 2012


#18897: query_posts / WP_query parameter 'offset' should play nicely with 'paged'
--------------------------+-----------------------------
 Reporter:  here          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Query         |     Version:  3.2.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------------
Changes (by coffee2code):

 * keywords:   => has-patch
 * version:   => 3.2.1
 * component:  General => Query
 * milestone:  Awaiting Review => Future Release


Comment:

 Judging by the inline comments, ignoring the 'paged' parameter when
 'offset' is set was intentional. It's been that way for 6 years seemingly
 without anyone complaining, and this ticket has sat without comment or
 patch for 7 months.

 That said, I don't know why a query with an offset can't also be paged.
 Sure, you can figure it all out manually and set the 'offset'
 appropriately, but it seems like the kind of thing WP_Query should just
 handle (barring some justification for the mutual exclusion).

 Attached is [attachment:18897.diff] which implements the functionality.
 Should be no impact, assuming no one is using both 'offset' and 'paged'
 and expecting 'paged' to be ignored. I just added unit tests (see [UT708]
 ) that include a test marked as a known bug due to this ticket and which
 passes when the patch is applied.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18897#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list