[wp-trac] [WordPress Trac] #36389: Selective refresh for widgets gets lost once `refresh` is used

WordPress Trac noreply at wordpress.org
Fri Apr 1 00:14:27 UTC 2016


#36389: Selective refresh for widgets gets lost once `refresh` is used
-------------------------------+------------------------------
 Reporter:  scamartist26       |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  trunk
 Severity:  normal             |  Resolution:  invalid
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by scamartist26):

 I wanted to add a note of my findings in case this behavior is seen by
 others. I placed the following code in a `mu-plugins` plugin:

 {{{#!php
 <?php
 add_action( 'after_setup_theme', function(){
         add_theme_support( 'customize-selective-refresh-widgets' );
 } );
 }}}

 This worked fine on the initial load in the Customizer, but then once the
 preview was fully refreshed it would not.
 The solution was simply to add a slightly later priority to the action
 like this:

 {{{#!php
 <?php
 add_action( 'after_setup_theme', function(){
         add_theme_support( 'customize-selective-refresh-widgets' );
 }, 11 );
 }}}

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


More information about the wp-trac mailing list