get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'blogname', array(
'selector' => '.site-title a',
'render_callback' => 'cenote_customize_partial_blogname',
) );
$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
'selector' => '.site-description',
'render_callback' => 'cenote_customize_partial_blogdescription',
) );
}
// Require upsell customizer section class.
require get_template_directory() . '/inc/class-cenote-upsell-section.php';
// Register `CENOTE_Upsell_Section` type section.
$wp_customize->register_section_type( 'CENOTE_Upsell_Section' );
// Add `CENOTE_Upsell_Section` to display pro link.
$wp_customize->add_section(
new CENOTE_Upsell_Section( $wp_customize, 'cenote_upsell_section',
array(
'title' => esc_html__( 'View PRO version', 'cenote' ),
'url' => 'https://themegrill.com/themes/cenote/?utm_source=cenote-customizer&utm_medium=view-pro-link&utm_campaign=view-pro#free-vs-pro',
'capability' => 'edit_theme_options',
'priority' => 1,
)
)
);
}
add_action( 'customize_register', 'cenote_customize_register' );
/**
* Render the site title for the selective refresh partial.
*
* @return void
*/
function cenote_customize_partial_blogname() {
bloginfo( 'name' );
}
/**
* Render the site tagline for the selective refresh partial.
*
* @return void
*/
function cenote_customize_partial_blogdescription() {
bloginfo( 'description' );
}
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function cenote_customize_preview_js() {
wp_enqueue_script( 'cenote-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), '20151215', true );
}
add_action( 'customize_preview_init', 'cenote_customize_preview_js' );
/**
* Add customize control scripts.
*/
function cenote_customize_controls_scripts() {
?>