add_section( 'business_center_pro_contact_section', array( 'title' => esc_html__( 'Contact Options','business-center-pro' ), 'description' => esc_html__( 'Contact options.', 'business-center-pro' ), 'panel' => 'business_center_pro_sections_panel', ) ); /** * Contact Options */ // Enable contact. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_contact]', array( 'default' => $options['enable_contact'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_contact]', array( 'label' => esc_html__( 'Enable Contact Section?', 'business-center-pro' ), 'section' => 'business_center_pro_contact_section', 'type' => 'checkbox' ) ); // Contact title. $wp_customize->add_setting( 'business_center_pro_theme_options[contact_title]', array( 'default' => $options['contact_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[contact_title]', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'label' => esc_html__( 'Title:', 'business-center-pro' ), 'section' => 'business_center_pro_contact_section', 'type' => 'text' ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'business_center_pro_theme_options[contact_title]', array( 'selector' => '#contact-form .entry-header .entry-title', 'render_callback' => 'business_center_pro_partial_contact_title', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } // Contact sub-title. $wp_customize->add_setting( 'business_center_pro_theme_options[contact_sub_title]', array( 'default' => $options['contact_sub_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[contact_sub_title]', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'label' => esc_html__( 'Sub Title:', 'business-center-pro' ), 'section' => 'business_center_pro_contact_section', 'type' => 'text' ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'business_center_pro_theme_options[contact_sub_title]', array( 'selector' => '#contact-form .entry-header .subtitle', 'render_callback' => 'business_center_pro_partial_contact_sub_title', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } // Contact bg image options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_contact_image]', array( 'default' => $options['custom_contact_image'], 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'business_center_pro_theme_options[custom_contact_image]', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'label' => esc_html__( 'Background Image ', 'business-center-pro' ), 'description' => esc_html__( 'The recommeded size for the image is 400px by 225px. ', 'business-center-pro' ), 'section' => 'business_center_pro_contact_section', ) ) ); // Contact shortcode image options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_contact_form_shortcode]', array( 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_contact_form_shortcode]', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'label' => __( 'Form Shortcode ', 'business-center-pro' ), 'section' => 'business_center_pro_contact_section', 'type' => 'text', 'input_attrs' => array( 'placeholder' => esc_attr__( '[contact-form-7 id="1880" title="Contact form 1"]', 'business-center-pro' ) ) ) ); for ($i=1; $i <= 3; $i++) { // Contact info icon options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_contact_info_icon_'.$i.']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_contact_info_icon_'.$i.']', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'label' => esc_html__( 'Info Icon ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_contact_section', 'type' => 'text', 'input_attrs' => array( 'placeholder' => esc_attr__( 'fa-archive', 'business-center-pro' ) ) ) ); // Contact info value options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_contact_info_value_'.$i.']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_contact_info_value_'.$i.']', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'label' => esc_html__( 'Info Value ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_contact_section', 'type' => 'text' ) ); // Horizontal Line $wp_customize->add_setting( 'business_center_pro_theme_options[contact_custom_hr_' . $i . ']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Business_Center_Pro_Customize_Horizontal_Line( $wp_customize, 'business_center_pro_theme_options[contact_custom_hr_' . $i . ']', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'section' => 'business_center_pro_contact_section', 'type' => 'hr', ) ) ); } // Contact shortcode image options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_contact_map_shortcode]', array( 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_contact_map_shortcode]', array( 'active_callback' => 'business_center_pro_is_contact_enable', 'label' => esc_html__( 'Map Shortcode ', 'business-center-pro' ), 'section' => 'business_center_pro_contact_section', 'type' => 'text', ) );