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

WordPress Trac noreply at wordpress.org
Fri Sep 6 13:17:18 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 SergeyBiryukov):

 Replying to [comment:3 jeremyfelt]:
 > [attachment:25158.2.diff] makes use of a local `$current_site =
 get_current_site();` when it makes sense rather than calling
 `get_current_site()` each time.

 I'd suggest doing the same in all the instances. It seems more future-
 proof in case more instances are added later in the same function.

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


More information about the wp-trac mailing list