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

WordPress Trac noreply at wordpress.org
Thu Oct 25 16:22:09 UTC 2012


#22090: Eliminate use of global $current_blog
--------------------------+---------------------
 Reporter:  ryan          |       Owner:  ryan
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  3.5
Component:  Multisite     |     Version:  3.4.2
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |
--------------------------+---------------------
Changes (by wdfee):

 * cc: wdfee (added)


Comment:

 don't know if it's caused by this, but using domain mapping in debug mode
 throws a lot of errors (using WP 3.5-beta2 by now):
 {{{
 Notice: Undefined property: stdClass::$blog_id in [...path...]/wp-
 includes/functions.php on line 3142
 }}}
 Because there isn't a $current_site->blog_id on a subsite.
 The solution is simple: change line 3142 from
 {{{
 return $blog_id == $current_site->blog_id;
 }}}

 to
 {{{
 return $blog_id == $current_site->id;
 }}}

 it is line 3154 in current trunk version, in function is_main_site(
 $blog_id = '' )

 Can you please change it and tell plugin authors (buddypress for example
 uses this, too), that this is to change now... Or am I somewhere wrong in
 the logic?

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


More information about the wp-trac mailing list