[wp-trac] [WordPress Trac] #35855: Let selective refresh component be required but be opt-in for sidebars/widgets (for now)

WordPress Trac noreply at wordpress.org
Fri Feb 26 04:30:19 UTC 2016


#35855: Let selective refresh component be required but be opt-in for
sidebars/widgets (for now)
----------------------------+--------------------------
 Reporter:  DrewAPicture    |       Owner:  westonruter
     Type:  task (blessed)  |      Status:  accepted
 Priority:  normal          |   Milestone:  4.5
Component:  Customize       |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+--------------------------

Comment (by DrewAPicture):

 Yeah, OK.

 In that case, I think theme support is the way to go, though I'd probably
 break it down a little bit in the name of forward compatibility, i.e.
 assuming there might be a future need to selectively selective refresh.

 In that vein, adding post formats support comes to mind, with a twist.

 What would you think about something along the lines of this:

 {{{#!php
 <?php
 // Single component (global on).
 add_theme_support( 'customize-selective-refresh', array( 'widgets' ) );

 // Multiple components (global on).
 add_theme_support( 'customize-selective-refresh', array( 'widgets',
 'other-thing' ) );


 // Specific widgets by `id_base`.
 add_theme_support( 'customize-selective-refresh', array(
         'widgets' => array( 'foo', 'bar' )
 ) );

 // Specific widgets by `id_base` plus global 'other-thing'.
 add_theme_support( 'customize-selective-refresh', array(
         'widgets' => array( 'foo', 'bar' ),
         'other-thing'
 ) );

 }}}

 Either way, the 'customize_selective_refresh' argument could independently
 override the "global on or off" via theme support, right?

 The big thing here is that I'm not sure we want to introduce a theme
 support for a specific component for a specific feature ('selective-
 refresh'). This approach leaves the door open if something else comes
 along later.

 Thoughts?

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


More information about the wp-trac mailing list