[wp-trac] [WordPress Trac] #31428: Switch_to_blog() no longer works in Customize using Multisite.

WordPress Trac noreply at wordpress.org
Mon Feb 23 21:07:28 UTC 2015


#31428: Switch_to_blog() no longer works in Customize using Multisite.
-------------------------------+------------------------------
 Reporter:  csschris           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  4.1.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  multisite
-------------------------------+------------------------------

Comment (by westonruter):

 OK, then it is probably due to #30988 and this logic added to
 `WP_Customize_Setting::preview()`:

 {{{
 if ( ! isset( $this->_original_value ) ) {
         $this->_original_value = $this->value();
 }
 }}}

 Since the `preview()` method gets evaluated before the `switch_to_blog()`
 call, it would the later prevent the `switch_to_blog()` call from
 overriding this initial value.

 ''However…'' is the plugin code intending to allow the Customizer to
 change the blogname for another site? Or are you just wanting to display
 the blogname for another site? If the latter case, then we probably need
 to update the `_preview_filter` method from modifying the value if the
 current blog is not the same as the initial blog when the `preview` method
 is called.

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


More information about the wp-trac mailing list