* enhance(project): Add .prettierrc to project * chore(deps): Bump dependencies * chore(view): Improve readability of the search form view * chore(admin): Improve language used in the customize_register filter docblock * chore(lint): Lint project assets * chore(change-log): Improve/prepare the changelog for actual release * chore(readme): Improve README feature list * chore(readme): Update README theme directory structure * chore(readme): Add GitHub sponsors badge * chore(readme): Clean up various wording * fix(ci): Fix failing tests * fix(mix): Add index.php to purgecss scope (Supersedes #2423) (Credit @oxyc)
37 lines
807 B
PHP
37 lines
807 B
PHP
<?php
|
|
|
|
/**
|
|
* Theme admin.
|
|
*/
|
|
|
|
namespace App;
|
|
|
|
use WP_Customize_Manager;
|
|
|
|
use function Roots\asset;
|
|
|
|
/**
|
|
* 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 () {
|
|
wp_enqueue_script('sage/customizer.js', asset('scripts/customizer.js')->uri(), ['customize-preview'], null, true);
|
|
});
|