id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 25680,is_main_query() _doing_it_wrong() notice suggests using WP_Query statically,dd32,wonderboymusic,"At present when `is_main_query()` is called within the `pre_get_posts` hook, it returns a `_doing_it_wrong()` error which refers to replacing it with `WP_Query::is_main_query()`. Obviously it's saying call the method on the WP_Query object, but some people can take that literally and call it statically. > Notice: is_main_query was called incorrectly. In pre_get_posts, use the WP_Query::is_main_query() method, not the is_main_query() function. We should instead, make mention to checking the passed $query object via `$query->is_main_query()` instead somehow. Example of how it was incorrectly used: {{{ if (( is_front_page() || is_home()) && WP_Query::is_main_query()) $query->set('post_type', array('wp_meetup_event', 'post')); }}}",defect (bug),closed,normal,4.4,Text Changes,,normal,fixed,has-patch commit,,