You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
624 B
25 lines
624 B
8 years ago
|
<?php
|
||
|
|
||
|
namespace App;
|
||
|
|
||
|
/**
|
||
|
* Theme customizer
|
||
|
*/
|
||
|
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');
|
||
|
}
|
||
|
]);
|
||
|
});
|
||
|
|
||
|
/**
|
||
|
* Customizer JS
|
||
|
*/
|
||
|
add_action('customize_preview_init', function () {
|
||
|
wp_enqueue_script('sage/customizer.js', asset_path('scripts/customizer.js'), ['customize-preview'], null, true);
|
||
|
});
|