[wp-trac] [WordPress Trac] #22090: Eliminate use of global $current_blog

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 3 20:54:21 UTC 2012


#22090: Eliminate use of global $current_blog
-------------------+--------------------------
 Reporter:  ryan   |       Type:  defect (bug)
   Status:  new    |   Priority:  normal
Milestone:  3.5    |  Component:  Multisite
  Version:  3.4.2  |   Severity:  normal
 Keywords:         |
-------------------+--------------------------
 $current_blog shouldn't be used outside of ms-settings.php and other core
 MS bootstrap files.  Use of it can lead to bugs such as this one in
 is_main_site():

 http://core.trac.wordpress.org/ticket/21459#comment:44
 http://wordpress.org/support/topic/switch_to_blog-does-not-properly-set-
 wp_upload_dir-vars

 Instead, get_blog_details( get_current_blog_id() ) should be used.
 get_blog_details() can default to the current blog id when not passed an
 argument to shorten this to get_blog_details().

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22090>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list