Why does the customizer.js and the admin.php both listen for changes in .brand?
I’m not sure if this is some kind of best practice, example code or does this serves some kind of other purpose.
wp.customize('blogname', (value) => {
value.bind(to => $('.brand').text(to));
});
.
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');
}
]);
});
/Edit:
On a less related note, why doesn’t this code use @if?
@php
if (post_password_required()) {
return;
}
@endphp