[wp-trac] [WordPress Trac] #18897: query_posts / WP_query parameter 'offset' should play nicely with 'paged'
WordPress Trac
noreply at wordpress.org
Tue Nov 26 21:01:35 UTC 2013
#18897: query_posts / WP_query parameter 'offset' should play nicely with 'paged'
------------------------------+-----------------------------
Reporter: here | Owner: wonderboymusic
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.8
Component: Query | Version: 3.2.1
Severity: normal | Resolution:
Keywords: has-patch commit |
------------------------------+-----------------------------
Comment (by here):
@wonderboymusic , the code linked by @bradyvercher in
http://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination#Offset_.26_Manual_Pagination
would break if a user were using both `paged` and `offset` . After this
patch, I believe that workaround code would cause the offset to be applied
twice.
That article was added in March 2013.
The offered explanation of a "good reason" for the current behvior is :
"There is a very good reason for this however... the offset argument is
actually the value WordPress uses to handle pagination itself. If a
developer sets a manual offset value, pagination will not function because
that value will override WordPress's automatic adjustment of the offset
for a given page."
As I don't feel well versed in the project's philosophy regarding this
type of breaking change, I'll defer on whether this patch is appropriate
for inclusion.
It is quite clear by the wiki article that the workaround is non-obvious
and non-trivial for most users. A new arg seems like an unfortunate
compromise , but may be the best possible solution .
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18897#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list