Opened 4 years ago
Last modified 4 years ago
#9978 new enhancement
Sticky Posts are not ordered correctly after selection
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Query | Version: | 2.8 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
In WP_Query, sticky posts are added/moved to the top of the posts array after everything else is selected and ordered according to the query parameters.
Sticky posts are loaded as a list of post_IDs from the database, according to the order they were marked as sticky.
Sticky posts that were not originally part of the returned posts are queried and added into the collection of sticky posts separately.
None of the handling of sticky posts, or the handling of the entire post array after stickies are added, is date ordered by date/title/whatever was requested.
Stickies need to be loaded/extracted into a separate array, ordered (independently) according to the original query, then added to the top of the post array.
Change History (3)
comment:1
beaulebens — 4 years ago
- Keywords needs-patch added
- Type changed from defect (bug) to enhancement

See Also: #9979 for details on an ordering bug/limitation that will affect the fixing of this bug.