get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->add_section("footer", array( "title" => __("Footer", "abstract-grid"), "priority" => 30, )); $wp_customize->add_setting("footer_code", array( "default" => "", "transport" => "postMessage", 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control(new WP_Customize_Control( $wp_customize, "footer", array( "label" => __("Footer Copyright", "abstract-grid"), "section" => "footer", "settings" => "footer_code", "type" => "text", ) )); //home slider setting $wp_customize->add_section("slider", array( "title" => __("Post Slider", "abstract-grid"), "priority" => 30, )); $wp_customize->add_setting("slider_code", array( "default" => "", "transport" => "postMessage", 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control(new WP_Customize_Control( $wp_customize, "slider", array( "label" => __("Show Slider", "abstract-grid"), "section" => "slider", "settings" => "slider_code", 'type' => 'select', 'choices' => array( 'show' => 'Show', 'hide' => 'Hide', ), ) )); $wp_customize->add_setting("slider_category", array( "default" => "", "transport" => "postMessage", 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control(new WP_Customize_Control( $wp_customize, "slider_category", array( "label" => __("Slider Category", "abstract-grid"), "section" => "slider", "settings" => "slider_category", 'type' => 'select', 'choices' => abstract_grid_all_category(), ) )); $wp_customize->add_setting("slider_amount", array( "default" => "", "transport" => "postMessage", 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control(new WP_Customize_Control( $wp_customize, "slider_amount", array( "label" => __("Slider Amount", "abstract-grid"), "section" => "slider", "settings" => "slider_amount", 'type' => 'text', ) )); } add_action( 'customize_register', 'abstract_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function abstract_customize_preview_js() { wp_enqueue_script( 'abstract_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'abstract_customize_preview_js' );