[wp-trac] [WordPress Trac] #12993: 'get_current_blog()' and/or 'current_blog_id()' function?

WordPress Trac wp-trac at lists.automattic.com
Wed May 12 11:26:23 UTC 2010


#12993: 'get_current_blog()' and/or 'current_blog_id()' function?
-----------------------------+----------------------------------------------
 Reporter:  martythornley    |       Owner:                       
     Type:  feature request  |      Status:  new                  
 Priority:  normal           |   Milestone:  Future Release       
Component:  Multisite        |     Version:  3.0                  
 Severity:  normal           |    Keywords:  current blog, blog id
-----------------------------+----------------------------------------------

Comment(by nacin):

 If you used the global $id in your plugin, you'd screw other things up. Or
 $post, $paged, $posts, and the like. If you're using them in local scope
 -- as you should be in an add_action callback -- then you're fine, though
 I'd avoid local variables being called the same as important WP globals
 just so someone reading your code isn't confused.

 I don't see how `$GLOBALS['blog_id']` is not foolproof to determining the
 current blog ID.

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


More information about the wp-trac mailing list