[wp-trac] [WordPress Trac] #27282: WP_Query returns more results when there are sticky posts
WordPress Trac
noreply at wordpress.org
Sat Jun 13 10:11:31 UTC 2015
#27282: WP_Query returns more results when there are sticky posts
--------------------------+-----------------------------
Reporter: markoheijnen | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Query | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+-----------------------------
Comment (by Trimension):
I think the whole discussion is very strange and you make the thinks much
more complicate than it really is. All "solutions" are more or less
workarounds but not really solutions.
The Bug(s) just relates to a design problem. The sticky-Bit is a property
of the Post !
But it is not a designed as a Property but is saved in a separate Options-
List. This makes it impossible to consider the Flag inside the Query.
Query ignores the flag and the query-method tries to put the separate
sticky-information afterwards into the result. This cannot really work.
Changing the Design (add a sticky column to the post-Table) would solve
all the problems discussed here. The Query itself could filter the results
on the sticky bit in the right way and could also order it correctly and
the pagination could do its job.
This simple design change would also bring some more benefits, because as
a Post-Property it doesn't need the restriction to be only available in
normal Posts but also in CPT's and it would also improve the performance
because one query is better than two, Right ?!
The sticky-Information would be always present and could be used in any
other logic without always querying against the Options and merging the
result.
This Solution would be a great improvement of Quality and Usability with
the next release.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27282#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list