add_section( 'business_center_pro_pricing_section', array( 'title' => esc_html__( 'Pricing Options','business-center-pro' ), 'description' => esc_html__( 'Pricing options.', 'business-center-pro' ), 'panel' => 'business_center_pro_sections_panel', ) ); /** * Pricing Options */ // Enable pricing. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_pricing]', array( 'default' => $options['enable_pricing'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_pricing]', array( 'label' => esc_html__( 'Enable Pricing Section?', 'business-center-pro' ), 'section' => 'business_center_pro_pricing_section', 'type' => 'checkbox' ) ); // Pricing title. $wp_customize->add_setting( 'business_center_pro_theme_options[pricing_title]', array( 'default' => $options['pricing_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[pricing_title]', array( 'active_callback' => 'business_center_pro_is_pricing_enable', 'label' => esc_html__( 'Title:', 'business-center-pro' ), 'section' => 'business_center_pro_pricing_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[pricing_title]', array( 'selector' => '#pricing-section .entry-header .entry-title', 'render_callback' => 'business_center_pro_partial_pricing_title', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } // Pricing sub-title. $wp_customize->add_setting( 'business_center_pro_theme_options[pricing_sub_title]', array( 'default' => $options['pricing_sub_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[pricing_sub_title]', array( 'active_callback' => 'business_center_pro_is_pricing_enable', 'label' => esc_html__( 'Sub Title:', 'business-center-pro' ), 'section' => 'business_center_pro_pricing_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[pricing_sub_title]', array( 'selector' => '#pricing-section .entry-header .subtitle', 'render_callback' => 'business_center_pro_partial_pricing_sub_title', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); } /** * Pricing content type options. */ $wp_customize->add_setting( 'business_center_pro_theme_options[pricing_content_type]', array( 'default' => $options['pricing_content_type'], 'sanitize_callback' => 'business_center_pro_sanitize_select', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[pricing_content_type]', array( 'active_callback' => 'business_center_pro_is_pricing_enable', 'label' => esc_html__( 'Content Type', 'business-center-pro' ), 'section' => 'business_center_pro_pricing_section', 'choices' => business_center_pro_pricing_content_type_options(), 'type' => 'select' ) ); // Number of pricing. $wp_customize->add_setting( 'business_center_pro_theme_options[number_of_pricing]', array( 'default' => $options['number_of_pricing'], 'sanitize_callback' => 'business_center_pro_sanitize_number_range', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[number_of_pricing]', array( 'active_callback' => 'business_center_pro_is_pricing_demo_disable', 'label' => esc_html__( 'Number of pricing? ( Max: 4 )', 'business-center-pro' ), 'description' => esc_html__( 'Note: Please refresh after changing the value to see the changes.', 'business-center-pro' ), 'section' => 'business_center_pro_pricing_section', 'input_attrs' => array( 'min' => 1, 'max' => 4 ), 'type' => 'number' ) ); for ( $i=1; $i <= $options['number_of_pricing']; $i++ ) { /** * Custom Content Type Options */ // Portfolio title options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_pricing_title_'.$i.']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_pricing_title_'.$i.']', array( 'active_callback' => 'business_center_pro_is_pricing_content_type_custom_enable', 'label' => esc_html__( 'Pricing Title ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_pricing_section', 'type' => 'text', ) ); // Portfolio content options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_pricing_content_'.$i.']', array( 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_pricing_content_'.$i.']', array( 'active_callback' => 'business_center_pro_is_pricing_content_type_custom_enable', 'label' => esc_html__( 'Pricing Content ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_pricing_section', 'type' => 'textarea', ) ); // Portfolio button text options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_pricing_button_text_'.$i.']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_pricing_button_text_'.$i.']', array( 'active_callback' => 'business_center_pro_is_pricing_content_type_custom_category_enable', 'label' => esc_html__( 'Button Text ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_pricing_section', 'type' => 'text', ) ); // Portfolio button text URL options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_pricing_btn_url_'.$i.']', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_pricing_btn_url_'.$i.']', array( 'active_callback' => 'business_center_pro_is_pricing_content_type_custom_enable', 'label' => esc_html__( 'Button URL ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_pricing_section', 'type' => 'url', ) ); // Horizontal Line $wp_customize->add_setting( 'business_center_pro_theme_options[pricing_content_type_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[pricing_content_type_hr' . $i . ']', array( 'active_callback' => 'business_center_pro_is_pricing_content_type_custom_enable', 'section' => 'business_center_pro_pricing_section', 'type' => 'hr', ) ) ); } /** * Category Content Type Options */ // Catgegory Options $wp_customize->add_setting( 'business_center_pro_theme_options[pricing_category]', array( 'sanitize_callback' => 'business_center_pro_sanitize_tax_checkbox' ) ); $wp_customize->add_control( new Business_Center_Pro_Customize_Control_Checkbox_Multiple( $wp_customize, 'business_center_pro_theme_options[pricing_category]', array( 'active_callback' => 'business_center_pro_is_pricing_content_type_category_enable', 'label' => esc_html__( 'Select Category', 'business-center-pro' ), 'section' => 'business_center_pro_pricing_section', 'type' => 'checkbox-multiple', 'taxonomy' => 'category', ) ) );