[wp-trac] [WordPress Trac] #35172: WordPress 4.4 pagination not working - Fix for 34060 broke backward compatibility

WordPress Trac noreply at wordpress.org
Mon Dec 21 14:04:31 UTC 2015


#35172: WordPress 4.4 pagination not working - Fix for 34060 broke backward
compatibility
-------------------------------------+------------------------------
 Reporter:  bobbingwide              |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Query                    |     Version:  4.4
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |     Focuses:
-------------------------------------+------------------------------

Comment (by boonebgorges):

 @bobbingwide Thanks for the clarifications.

 It's not unreasonable to want 'paged' and 'offset' to work together more
 elegantly. But this turns out to be harder than it seems. See #18897,
 [26012], [26525] for more details.

 Reversing the order of preference so that 'paged' always wins will break
 backward compatibility for more extensively than what you've reported
 here. 'offset' has taken precedence since it was introduced in [3867] (!).

 I'm not sure how to interpret your comment about 'numberposts'.
 `get_posts()` translates `numberposts` to `posts_per_page=-1`. If
 `WP_Query` sees `posts_per_page=-1`, it sets `nopaging=true`. If
 `nopaging=true`, then `offset` is ignored. This has always been the case,
 so I don't think it's a 4.4 regression.

 For these reasons, I'd like to mark this ticket as wontfix. I acknowledge
 that the `0` behavior changes behavior, but I think it's a relatively easy
 fix for a very large improvement in the API. To follow future improvements
 in paged offsets, see #18897.

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


More information about the wp-trac mailing list