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

WordPress Trac noreply at wordpress.org
Fri Nov 29 00:20:47 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:  3.8
Component:  Text Changes  |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------

Comment (by nofearinc):

 I would leave it as is, there are other instances in core following that
 pattern and, while not obvious, they are technically correct.

 Several related examples could be found in `wp-includes/wp-db.php`, both
 in `_deprecated_function` calls and PHPDoc, such as:

 {{{
 _deprecated_function( __FUNCTION__, '3.5', 'wpdb::has_cap( \'collation\'
 )' );
 }}}

 Even though `global $wpdb` is usually set, other instances could be
 initialized as well.

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


More information about the wp-trac mailing list