[wp-trac] [WordPress Trac] #18035: ignore_sticky_posts fails to remove sticky class

WordPress Trac noreply at wordpress.org
Tue Dec 16 14:01:11 UTC 2014


#18035: ignore_sticky_posts fails to remove sticky class
---------------------------------------------+-------------------------
 Reporter:  mikkelbreum                      |       Owner:  johneckman
     Type:  enhancement                      |      Status:  reopened
 Priority:  normal                           |   Milestone:  4.1
Component:  Query                            |     Version:  3.2
 Severity:  normal                           |  Resolution:
 Keywords:  good-first-bug has-patch revert  |     Focuses:  template
---------------------------------------------+-------------------------
Changes (by helen):

 * keywords:  good-first-bug has-patch => good-first-bug has-patch revert


Comment:

 Even though we already rely on the state of the `$wp_query` global in the
 other parts of the conditional, looking at a query var that might not be
 from that particular loop seems extra wrong. I also don't think a post
 stops being marked as sticky based on the query that's being run. The
 global `is_main_query()` function is deprecated (see #23329) so the
 following patch is a no-go.

 This definitely breaks things visually on the front for anybody who was
 previously styling sticky posts whether or not they were floated to the
 top in the query, which to me is a separate concern from an HTML/CSS
 class. I'm also sure there are people out there who use stickies to
 indicate some kind of importance without necessarily always chucking them
 to the front and rely on the class being there, no matter what that query
 var says.

 Suggest revert and wontfix - not only do I think that we are mixing
 concerns here, but even if we weren't, there's no way this doesn't at
 least cause visual breakage in themes.

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


More information about the wp-trac mailing list