Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18035, comment 23


Ignore:
Timestamp:
12/16/2014 02:30:57 PM (12 years ago)
Author:
helen

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18035, comment 23

    initial v1  
    55> `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.
    66
    7 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.
     7Came 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 (sometimes applied to secondary queries because of global state) 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.