add_section( 'business_center_pro_call_to_action_section', array( 'title' => esc_html__( 'Call To Action Options','business-center-pro' ), 'description' => esc_html__( 'Call To Action options.', 'business-center-pro' ), 'panel' => 'business_center_pro_sections_panel', ) ); /** * Call To Action Options */ // Enable call_to_action. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_call_to_action]', array( 'default' => $options['enable_call_to_action'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_call_to_action]', array( 'label' => esc_html__( 'Enable Call To Action Section?', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_section', 'type' => 'checkbox' ) ); /** * Call To Action content type options. */ $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_content_type]', array( 'default' => $options['call_to_action_content_type'], 'sanitize_callback' => 'business_center_pro_sanitize_select', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[call_to_action_content_type]', array( 'active_callback' => 'business_center_pro_is_call_to_action_enable', 'label' => esc_html__( 'Content Type', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_section', 'choices' => business_center_pro_call_to_action_content_type_options(), 'type' => 'select' ) ); // Call To Action title. $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_title]', array( 'default' => $options['call_to_action_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[call_to_action_title]', array( 'active_callback' => 'business_center_pro_is_call_to_action_content_type_custom_enable', 'label' => esc_html__( 'Title:', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_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[call_to_action_title]', array( 'selector' => '#join-us .entry-header .entry-title', 'render_callback' => 'business_center_pro_partial_call_to_action_title', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } // Call To Action sub-title. $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_sub_title]', array( 'default' => $options['call_to_action_sub_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[call_to_action_sub_title]', array( 'active_callback' => 'business_center_pro_is_call_to_action_content_type_custom_enable', 'label' => esc_html__( 'Sub Title:', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_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[call_to_action_sub_title]', array( 'selector' => '#join-us .entry-header .subtitle', 'render_callback' => 'business_center_pro_partial_call_to_action_sub_title', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } // Call To Action content $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_content]', array( 'default' => $options['call_to_action_content'], 'sanitize_callback' => 'esc_textarea', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[call_to_action_content]', array( 'active_callback' => 'business_center_pro_is_call_to_action_content_type_custom_enable', 'label' => esc_html__( 'Content:', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_section', 'type' => 'textarea' ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'business_center_pro_theme_options[call_to_action_content]', array( 'selector' => '#join-us .entry-content p', 'render_callback' => 'business_center_pro_partial_call_to_action_content', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } // Call To Action background image $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_bg_image]', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'business_center_pro_theme_options[call_to_action_bg_image]', array( 'active_callback' => 'business_center_pro_is_call_to_action_content_type_custom_enable', 'label' => esc_html__( 'Background Image:', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_section', ) ) ); /** * Post Content Type Options */ // Post Options $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_post]', array( 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[call_to_action_post]', array( 'active_callback' => 'business_center_pro_is_call_to_action_content_type_post_enable', 'label' => esc_html__( 'Post ID: ', 'business-center-pro' ), 'description' => esc_html__( 'Enter the post id here. The featured image will be used as background image. ', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_section', 'type' => 'number', ) ); // Call To Action btn text $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_btn_txt]', array( 'default' => $options['call_to_action_btn_txt'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[call_to_action_btn_txt]', array( 'active_callback' => 'business_center_pro_is_call_to_action_demo_disable', 'label' => esc_html__( 'Button Text:', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_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[call_to_action_btn_txt]', array( 'selector' => '#join-us .entry-content a.btn', 'render_callback' => 'business_center_pro_partial_call_to_action_btn_txt', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } // Call To Action btn text url $wp_customize->add_setting( 'business_center_pro_theme_options[call_to_action_btn_url]', array( 'default' => $options['call_to_action_btn_url'], 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[call_to_action_btn_url]', array( 'active_callback' => 'business_center_pro_is_call_to_action_content_type_custom_enable', 'label' => esc_html__( 'Button URL:', 'business-center-pro' ), 'section' => 'business_center_pro_call_to_action_section', 'type' => 'url' ) );