[wp-trac] [WordPress Trac] #25158: Use get_current_site() instead of the $current_site global when possible

WordPress Trac noreply at wordpress.org
Tue Aug 27 17:07:00 UTC 2013


#25158: Use get_current_site() instead of the $current_site global when possible
--------------------------+------------------------------
 Reporter:  jeremyfelt    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Multisite     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by nacin):

 If a function is repeatedly calling get_current_site(), one option is to
 also assign get_current_site() to a local variable $current_site, and
 remove the globalization, at which point you won't need to change the
 function otherwise. This is how we resolved using get_post() instead of
 the global $post without rewriting dozens of $post references.

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


More information about the wp-trac mailing list