selective_refresh ) ? 'postMessage' : 'refresh'; /*========================================= CTA Section =========================================*/ $wp_customize->add_panel( 'artech_frontpage_sections', array( 'priority' => 32, 'title' => esc_html__( 'Frontpage Sections', 'artech' ), ) ); $wp_customize->add_section( 'cta2_setting', array( 'title' => esc_html__( 'Call to Action 2 Section', 'artech' ), 'priority' => 6, 'panel' => 'artech_frontpage_sections', ) ); // CTA Description // $wp_customize->add_setting( 'cta2_description', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'priority' => 6, ) ); $wp_customize->add_control( 'cta2_description', array( 'label' => __('Description','artech'), 'section' => 'cta2_setting', 'type' => 'textarea', ) ); $wp_customize->add_setting( 'cta2_count_btn_lbl', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'priority' => 9, ) ); $wp_customize->add_control( 'cta2_count_btn_lbl', array( 'label' => __('Button Label','artech'), 'section' => 'cta2_setting', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta2_count_btn_link', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_url', 'priority' => 9, ) ); $wp_customize->add_control( 'cta2_count_btn_link', array( 'label' => __('Button Link','artech'), 'section' => 'cta2_setting', 'type' => 'text', ) ); $wp_customize->add_setting( 'cta2_count_btn_desc', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'artech_sanitize_html', 'priority' => 9, ) ); $wp_customize->add_control( 'cta2_count_btn_desc', array( 'label' => __('Count Button Description','artech'), 'section' => 'cta2_setting', 'type' => 'text', ) ); } add_action( 'customize_register', 'artech_cta2_setting' ); // CTA selective refresh function artech_cta2_section_partials( $wp_customize ){ // cta2_title $wp_customize->selective_refresh->add_partial( 'cta2_title', array( 'selector' => '.cta-section-home .cta-content h3', 'settings' => 'cta2_title', 'render_callback' => 'artech_cta2_title_render_callback', ) ); // cta2_description $wp_customize->selective_refresh->add_partial( 'cta2_description', array( 'selector' => '.cta-section-home .cta-content p', 'settings' => 'cta2_description', 'render_callback' => 'artech_cta2_description_render_callback', ) ); // cta2_whatsapp_icon $wp_customize->selective_refresh->add_partial( 'cta2_whatsapp_icon', array( 'selector' => '.cta-section-home .cta-right .widget-contact .contact-icon i', 'settings' => 'cta2_whatsapp_icon', 'render_callback' => 'artech_cta2_whatsapp_icon_render_callback', ) ); // cta2_whatsapp_number $wp_customize->selective_refresh->add_partial( 'cta2_whatsapp_number', array( 'selector' => '.cta-section-home .cta-right .widget-contact .contact-info p a', 'settings' => 'cta2_whatsapp_number', 'render_callback' => 'artech_cta2_whatsapp_number_render_callback', ) ); // cta2_call_icon $wp_customize->selective_refresh->add_partial( 'cta2_call_icon', array( 'selector' => '.cta-section-home .cta-left .widget-contact .contact-icon i', 'settings' => 'cta2_call_icon', 'render_callback' => 'artech_cta2_whatsapp_icon_render_callback', ) ); // cta2_phone_number $wp_customize->selective_refresh->add_partial( 'cta2_phone_number', array( 'selector' => '.cta-section-home .cta-left .widget-contact .contact-info p a', 'settings' => 'cta2_phone_number', 'render_callback' => 'artech_cta2_phone_number_render_callback', ) ); // cta2_btn_lbl $wp_customize->selective_refresh->add_partial( 'cta2_btn_lbl', array( 'selector' => '.cta-section-home .cta-content .main-btn', 'settings' => 'cta2_btn_lbl', 'render_callback' => 'artech_cta2_description_render_callback', ) ); // cta2_video_url $wp_customize->selective_refresh->add_partial( 'cta2_video_url', array( 'selector' => '.cta-section-home .cta-center .cta-play-btn a i', 'settings' => 'cta2_video_url', 'render_callback' => 'artech_cta2_video_url_render_callback', ) ); } add_action( 'customize_register', 'artech_cta2_section_partials' ); // cta2_title function artech_cta2_title_render_callback() { return get_theme_mod( 'cta2_title' ); } // cta2_description function artech_cta2_description_render_callback() { return get_theme_mod( 'cta2_description' ); } // cta2_whatsapp_number function artech_cta2_whatsapp_number_render_callback() { return get_theme_mod( 'cta2_whatsapp_number' ); } // cta2_phone_number function artech_cta2_phone_number_render_callback() { return get_theme_mod( 'cta2_phone_number' ); } // cta2_btn_lbl function artech_cta2_btn_lbl_render_callback() { return get_theme_mod( 'cta2_btn_lbl' ); } // cta2_video_url function artech_cta2_video_url_render_callback() { return get_theme_mod( 'cta2_video_url' ); }