Files
bedrock/app/admin.php
Kelly Mears 69dfbfc65c Replace Laravel Mix with Bud (#2643)
Co-authored-by: QWp6t <hi@qwp6t.me>
Co-authored-by: Ben Word <ben@benword.com>
2021-11-21 23:53:01 -06:00

37 lines
755 B
PHP

<?php
/**
* Theme admin.
*/
namespace App;
use WP_Customize_Manager;
use function Roots\bundle;
/**
* Register the `.brand` selector to the blogname.
*
* @param \WP_Customize_Manager $wp_customize
* @return void
*/
add_action('customize_register', function (WP_Customize_Manager $wp_customize) {
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial('blogname', [
'selector' => '.brand',
'render_callback' => function () {
bloginfo('name');
}
]);
});
/**
* Register the customizer assets.
*
* @return void
*/
add_action('customize_preview_init', function () {
bundle('customizer')->enqueueJs(true, ['customize-preview']);
});