Enable selective refresh for widgets in customizer (#1778)

This commit is contained in:
Ben Word
2016-12-25 15:48:18 -07:00
committed by QWp6t
parent 121e3f20d7
commit 725ee8446b
2 changed files with 12 additions and 0 deletions

View File

@@ -8,6 +8,12 @@ namespace App;
add_action('customize_register', function (\WP_Customize_Manager $wp_customize) {
// Add postMessage support
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial('blogname', [
'selector' => '.brand',
'render_callback' => function () {
bloginfo('name');
}
]);
});
/**