[wp-trac] [WordPress Trac] #10471: Phase out the use of the global keyword

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 30 12:59:49 UTC 2009


#10471: Phase out the use of the global keyword
--------------------------------+-------------------------------------------
 Reporter:  prettyboymp         |        Type:  feature request
   Status:  new                 |    Priority:  normal         
Milestone:  Future Release      |   Component:  General        
  Version:  2.9                 |    Severity:  trivial        
 Keywords:  global back-compat  |  
--------------------------------+-------------------------------------------

Comment(by prettyboymp):

 I don't know that even $post should still be accessed as a global
 variable.  Since it is just pointing to the current post within the
 $wp_query posts array.  Shouldn't it be like:
 {{{
 $wp_query &= WP_Query::get_instance(); or &= wp_get_wp_query_instance();
 $post = $wp_query->get_the_query();

 //and if php4 is finally dropped
 $post = WP_Query::get_instance()->get_the_query();
 }}}

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


More information about the wp-trac mailing list