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' => 'abteam_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'abteam_customize_partial_blogdescription', ) ); } $wp_customize->add_section( 'header_area', array( 'title' => __( 'Header Settings', 'abteam' ), 'priority' => 40, ) ); $wp_customize->add_setting( 'header_main_title', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'header_main_title', array( 'type' => 'text', 'label' => __( 'Enter Main Title:', 'abteam' ), 'description' => __( 'Leave this setting blank to disable it.', 'abteam' ), 'section' => 'header_area', ) ); $wp_customize->add_setting( 'header_subheading_title', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'header_subheading_title', array( 'type' => 'text', 'label' => __( 'Enter Sub Title:', 'abteam' ), 'description' => __( 'Leave this setting blank to disable it.', 'abteam' ), 'section' => 'header_area', ) ); $wp_customize->add_section( 'service_section', array( 'title' => __( 'Service Section', 'abteam' ), ) ); $wp_customize->add_setting( 'service_title_one', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'service_title_one', array( 'type' => 'text', 'label' => __( 'Enter Title 1:', 'abteam' ), 'description' => __( 'Leave blank to disable it.', 'abteam' ), 'section' => 'service_section', ) ); $wp_customize->add_setting( 'service_desc_one', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'service_desc_one', array( 'type' => 'text', 'label' => __( 'Enter Description 1:', 'abteam' ), 'description' => __( 'Leave blank to disable it.', 'abteam' ), 'section' => 'service_section', ) ); $wp_customize->add_setting( 'service_title_two', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'service_title_two', array( 'type' => 'text', 'label' => __( 'Enter Title 2:', 'abteam' ), 'description' => __( 'Leave blank to disable it.', 'abteam' ), 'section' => 'service_section', ) ); $wp_customize->add_setting( 'service_desc_two', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'service_desc_two', array( 'type' => 'text', 'label' => __( 'Enter Description 2:', 'abteam' ), 'description' => __( 'Leave blank to disable it.', 'abteam' ), 'section' => 'service_section', ) ); $wp_customize->add_setting( 'service_title_three', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'service_title_three', array( 'type' => 'text', 'label' => __( 'Enter Title 3:', 'abteam' ), 'description' => __( 'Leave blank to disable it.', 'abteam' ), 'section' => 'service_section', ) ); $wp_customize->add_setting( 'service_desc_three', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'service_desc_three', array( 'type' => 'text', 'label' => __( 'Enter Description 3:', 'abteam' ), 'description' => __( 'Leave blank to disable it.', 'abteam' ), 'section' => 'service_section', ) ); } add_action( 'customize_register', 'abteam_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function abteam_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function abteam_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function abteam_customize_preview_js() { wp_enqueue_script( 'abteam-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), ABTEAM_VERSION, true ); } add_action( 'customize_preview_init', 'abteam_customize_preview_js' );