[wp-trac] [WordPress Trac] #37607: get_site() does not return the current site when multisite is in a switched state

WordPress Trac noreply at wordpress.org
Mon Aug 8 22:32:48 UTC 2016


#37607: get_site() does not return the current site when multisite is in a switched
state
--------------------------------------+-------------------------
 Reporter:  jeremyfelt                |       Owner:  jeremyfelt
     Type:  defect (bug)              |      Status:  accepted
 Priority:  normal                    |   Milestone:  4.6
Component:  Networks and Sites        |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+-------------------------

Comment (by jeremyfelt):

 In [changeset:"38217"]:
 {{{
 #!CommitTicketReference repository="" revision="38217"
 Multisite: Use `get_current_blog_id()` in `get_site()` for current site.

 The global `$current_blog` is not switched in `switch_to_blog()` and can
 not be used to properly retrieve current switched site information.

 See #37607.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37607#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list