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' => 'blogmarks_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'blogmarks_customize_partial_blogdescription', ) ); } // Some Defaults to reference. $theme_options_defaults = blogmarks_get_default_customizer_values(); // Register custom section types. $wp_customize->register_section_type( 'Blogmarks_Section_Features_List' ); /*Load customizer options.*/ require_once get_template_directory() . '/include/customizer/option-panel/option-panel-init.php'; } add_action( 'customize_register', 'blogmarks_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function blogmarks_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function blogmarks_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function blogmarks_customize_preview_js() { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'blogmarks-customizer', get_template_directory_uri() . '/assets/interface/js/customizer' . $min . '.js', array( 'customize-preview' ), _S_VERSION, true ); } add_action( 'customize_preview_init', 'blogmarks_customize_preview_js' ); /** * Customizer control scripts and styles. * * @since 1.0.0 */ function blogmarks_customizer_control_scripts() { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_style( 'blogmarks-customizer-css', get_template_directory_uri() . '/assets/interface/css/customizer' . $min . '.css', array(), _S_VERSION ); wp_enqueue_script( 'blogmarks-customizer-controls', get_template_directory_uri() . '/assets/interface/js/customizer-admin' . $min . '.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'customize-controls' ), _S_VERSION, true ); } add_action( 'customize_controls_enqueue_scripts', 'blogmarks_customizer_control_scripts', 0 );