[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
Tue Mar 15 17:21:57 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 westonruter):
@obenland changing the `transport` would work well if there was a single
setting to flip over to `postMessage`. The problem is it's a whole range
of settings that need to change the default `transport` for. As for a
`WP_Customize_Manager` flag… perhaps, but it could get tricky to add the
hook early enough, like:
{{{#!php
<?php
function twentytwenty_customize_widgets_selective_refresh_optin(
$wp_customize ) {
if ( isset( $wp_customize->widgets ) ) {
$wp_customize->widgets->selective_refresh_support = true;
}
}
add_action( 'customize_register',
'twentytwenty_customize_widgets_selective_refresh_optin' );
}}}
Something like that? Maybe this would better in terms of encapsulation and
reducing globals, but it seems an undue burden for themers vs:
{{{#!php
<?php
add_theme_support( 'customize-selective-refresh-widgets' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35855#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list