[wp-trac] [WordPress Trac] #25293: Switch_to_blog not switching the siteid

WordPress Trac noreply at wordpress.org
Tue Sep 6 20:41:38 UTC 2016


#25293: Switch_to_blog not switching the siteid
------------------------------------------------+--------------------------
 Reporter:  Rahe                                |       Owner:
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  Future
Component:  Networks and Sites                  |  Release
 Severity:  minor                               |     Version:  3.0
 Keywords:  has-patch dev-feedback 2nd-opinion  |  Resolution:
                                                |     Focuses:  multisite
------------------------------------------------+--------------------------

Comment (by tfrommen):

 Replying to [comment:11 flixos90]:
 > Based on this ticket and also #37958 (plus today's Multisite chat
 discussion), I implemented a first take on a `WP_State` class in
 [attachment:25293.diff]. This class manages switching between sites and
 contains some enhanced functionality...

 Personally, I don't like the patch because it introduces a class that does
 too many (related, and yet clearly distinct) things.

 The class that allows to create a ''snapshot'' of the current network
 state really only needs a single method to restore. Nothing more.

 If switching sites will be done by means of a (new) class, then the
 network state class just grabs it and uses it (instead of calling
 `switch_to_blog()`).

 And if we want to account for breakpoints (which should '''not''' be
 handled by the network state class), these should actually be an array of
 `NetworkState` objects! Makes sense, right? :)

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


More information about the wp-trac mailing list