[wp-trac] [WordPress Trac] #9978: Sticky Posts are not ordered correctly after selection
WordPress Trac
noreply at wordpress.org
Thu Aug 8 00:50:56 UTC 2013
#9978: Sticky Posts are not ordered correctly after selection
-------------------------+-------------------
Reporter: beaulebens | Owner: ryan
Type: enhancement | Status: new
Priority: normal | Milestone: 3.7
Component: Query | Version: 2.8
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+-------------------
Changes (by wonderboymusic):
* keywords: needs-patch => has-patch
* milestone: Future Release => 3.7
Comment:
Moving to 3.7 for more discussion
Here is what currently happens:
1. Posts are queried
1. If the result set contains stickies, those stickies are arbitrarily
moved to the top
1. If there are stickies that weren't queried, and they don't appear in
`post_not__in`, extra stickies are queried and shoved between the stickies
at the top and the rest of the post
1. No "order" is even considered
What [attachment:9978.diff 9978.diff] does:
1. Posts are queried
1. If the result set contains stickies, those stickies are removed from
the results
1. All stickies that aren't in `post_not__in` are queried in `get_posts()`
with the args `order` and `orderby` passed
1. All stickies are placed at the top after returning ordered
1. Profit.
Also of note, no stickies are currently added to `$this->posts` when
`fields` is passed as an arg - expected behavior?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9978#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list