[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
Sun Mar 20 05:57:38 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: blocker | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+--------------------------
Comment (by westonruter):
Based on my [https://core.trac.wordpress.org/ticket/35855#comment:46
comment above] and the most recent [https://wordpress.slack.com/archives
/core-customize/p1458401841000119 conversation on Slack], I've returned to
using a single:
{{{
add_theme_support( 'customize-selective-refresh-widgets' )
}}}
instead of (multiple) call(s) to:
{{{
register_sidebar( array( /*...*/ 'customize_selective_refresh' => true ) )
}}}
Widgets will still have the `customize_selective_refresh` widget option to
specify to indicate support at the widget level.
I've also updated my Twenty Sixteen PR to use the theme support feature:
https://github.com/WordPress/twentysixteen/pull/430
The hope is that with a critical mass adoption, these supports flags can
be added by default so that themes and widgets have to opt-out instead of
opt-in. For now, however, there would be a large number of breakages for
widgets in the Customizer preview if this is enabled by default.
For patch review, please see diff with whitespace changes suppressed
(since as part of this the selective refresh component is no longer
included among those which can be filtered off): https://github.com/xwp
/wordpress-develop/pull/144/files?w=1
I hope to commit this on Sunday (PDT) and then on Monday I plan to follow
up with a post on Make Core and cross-post on Make Themes to document how
theme and widget authors can add support and why they should do so.
@MH Themes please review the patch and check for compatibility with your
code if no support flags are included.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35855#comment:48>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list