get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; // Load customize option. require get_template_directory() . '/inc/customizer/option.php'; // Load slider customize option. require get_template_directory() . '/inc/customizer/slider.php'; // Load featured content customize option. require get_template_directory() . '/inc/customizer/featured-content.php'; // Load reset option. require get_template_directory() . '/inc/customizer/reset.php'; } add_action( 'customize_register', 'bizroot_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. * * @since 1.0.0 */ function bizroot_customize_preview_js() { wp_enqueue_script( 'bizroot_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'bizroot_customize_preview_js' ); /** * Add Upgrade To Pro button. * * @since 1.0.0 */ function bizroot_custom_customize_enqueue_scripts() { wp_register_script( 'bizroot_customizer_button', get_template_directory_uri() . '/js/customizer-button.js', array( 'customize-controls' ), '20130508', true ); $data = array( 'updrade_button_text' => __( 'Upgrade To Pro', 'bizroot' ), 'updrade_button_link' => esc_url( 'http://wenthemes.com' ), ); wp_localize_script( 'bizroot_customizer_button', 'Bizroot_Customizer_Object', $data ); wp_enqueue_script( 'bizroot_customizer_button' ); } add_action( 'customize_controls_enqueue_scripts', 'bizroot_custom_customize_enqueue_scripts' ); /** * Load styles for Customizer. * * @since 1.0.0 */ function bizroot_load_customizer_styles() { global $pagenow; if ( 'customize.php' === $pagenow ) { wp_register_style( 'bizroot-customizer-style', get_template_directory_uri() . '/css/customizer.min.css', false, '1.0.0' ); wp_enqueue_style( 'bizroot-customizer-style' ); } } add_action( 'admin_enqueue_scripts', 'bizroot_load_customizer_styles' );