[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:20:44 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 csschris):

 Replying to [comment:5 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.

 In that example I just want to show the name of the other blog. My actual
 use case is I show a menu from the main site (blog id 1) on all sub sites.

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


More information about the wp-trac mailing list