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

WordPress Trac noreply at wordpress.org
Tue Dec 16 14:29:53 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
---------------------------------------------+-------------------------

Comment (by helen):

 Replying to [comment:22 SergeyBiryukov]:
 > Replying to [comment:21 helen]:
 > > The global `is_main_query()` function is deprecated (see #23329) so
 the following patch is a no-go.
 >
 > `is_main_query()` only issues a notice when being called from
 `pre_get_posts`. It still have a valid use case otherwise ("is `$wp_query`
 the main query?"), see comment:3:ticket:23329, which is exactly the use
 case here.

 Came back here to say oops, because you are correct and I am asleep at the
 wheel. :) Also, upon further thought, by default this class seems rather
 unreliable outside of the good old first-page-of-home-main-query context.
 If we add is_main_query(), I guess the default behavior overall would
 become more correct, though I'd still be concerned about how (custom)
 themes are potentially affected. But in any case, let's revert and try
 again later.

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


More information about the wp-trac mailing list