[wp-trac] [WordPress Trac] #25680: is_main_query() _doing_it_wrong() notice suggests using WP_Query statically

WordPress Trac noreply at wordpress.org
Tue Dec 3 18:49:28 UTC 2013


#25680: is_main_query() _doing_it_wrong() notice suggests using WP_Query statically
-------------------------------+------------------------------
 Reporter:  dd32               |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Text Changes       |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  2nd-opinion close  |
-------------------------------+------------------------------

Comment (by DrewAPicture):

 I could see doing something like the this:

 > In `pre_get_posts`, the standalone `is_main_query()` function should not
 be used. Use the passed `WP_Query` object's `is_main_query()` class method
 instead. See <URL>.

 It probably wouldn't hurt to flesh out that Codex article either, maybe
 with a section specifically explaining the difference between the function
 and the method that we could link to.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25680#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list