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' => 'blogbull_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'blogbull_customize_partial_blogdescription', ) ); } /*Get default values to set while building customizer elements*/ $blogbull_default = blogbull_get_all_customizer_default_values(); // Register custom section types. $wp_customize->register_section_type( 'Blogbull_Section_Features_List' ); require_once get_template_directory() . '/inc/admin/customizer/sections/panel.php'; } add_action( 'customize_register', 'blogbull_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function blogbull_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function blogbull_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function blogbull_customize_preview_js() { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'blogbull-customizer-js', get_template_directory_uri() . '/inc/admin/customizer/assets/js/customizer' . $min . '.js', array( 'customize-preview' ), BLOGBULL_VERSION, true ); } add_action( 'customize_preview_init', 'blogbull_customize_preview_js' ); /** * Customizer control scripts and styles. * * @since BlogBull 1.0.0 */ function blogbull_customizer_control_scripts() { $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; $file_name = is_rtl() ? 'customizer-rtl' . $suffix . '.css' : 'customizer' . $suffix . '.css'; wp_enqueue_style( 'blogbull-admin-style', get_template_directory_uri() . '/inc/admin/customizer/assets/css/' . $file_name, array(), BLOGBULL_VERSION ); } add_action( 'customize_controls_enqueue_scripts', 'blogbull_customizer_control_scripts', 0 );