get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_section('header_image')->title = __( 'Header Settings', 'draftly' ); if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'draftly_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'draftly_customize_partial_blogdescription', ) ); } $wp_customize->selective_refresh->add_partial( 'custom_logo', array( 'selector' => '.header-titles [class*=site-]:not(.site-description)', 'render_callback' => 'draftly_customize_partial_site_logo', ) ); $wp_customize->selective_refresh->add_partial( 'retina_logo', array( 'selector' => '.header-titles [class*=site-]:not(.site-description)', 'render_callback' => 'draftly_customize_partial_site_logo', ) ); /* New Section */ $wp_customize->add_setting( 'hide_header_text', array( 'default' => 0, 'sanitize_callback' => 'draftly_sanitize_checkbox', ) ); $wp_customize->add_control( 'hide_header_text', array( 'label' => __( 'Hide Header Text', 'draftly' ), 'section' => 'header_image', 'priority' => 1, 'settings' => 'hide_header_text', 'type' => 'checkbox', ) ); /* New Section */ $wp_customize->add_section( 'sidebar_settings', array( 'title' => __('Sidebar Settings','draftly'), 'priority' => 1, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'sidebar_hide', array( 'default' => 0, 'sanitize_callback' => 'draftly_sanitize_checkbox', ) ); $wp_customize->add_control( 'sidebar_hide', array( 'label' => __( 'Hide Sidebar', 'draftly' ), 'section' => 'sidebar_settings', 'priority' => 0, 'settings' => 'sidebar_hide', 'type' => 'checkbox', ) ); function draftly_sanitize_checkbox( $input ) { if ( $input === true || $input === '1' ) { return '1'; } return ''; } } add_action( 'customize_register', 'draftly_customize_register' ); if(! function_exists('draftly_customizer_css_final_output' ) ): function draftly_customizer_css_final_output(){ ?>