get_bloginfo( 'version' ) ) { $wp_customize->add_panel( 'automobile_featured_content_options', array( 'capability' => 'edit_theme_options', 'description' => __( 'Featured Content Options', 'automobile' ), 'priority' => 400, 'title' => __( 'Featured Content', 'automobile' ), ) ); $wp_customize->add_section( 'automobile_featured_content_settings', array( 'panel' => 'automobile_featured_content_options', 'priority' => 1, 'title' => __( 'Featured Content Options', 'automobile' ), ) ); } else { $wp_customize->add_section( 'automobile_featured_content_settings', array( 'priority' => 400, 'title' => __( 'Featured Content', 'automobile' ), ) ); } $wp_customize->add_setting( 'automobile_theme_options[featured_content_option]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_option'], 'sanitize_callback' => 'automobile_sanitize_select', ) ); $automobile_featured_slider_content_options = automobile_featured_slider_content_options(); $choices = array(); foreach ( $automobile_featured_slider_content_options as $automobile_featured_slider_content_option ) { $choices[$automobile_featured_slider_content_option['value']] = $automobile_featured_slider_content_option['label']; } $wp_customize->add_control( 'automobile_theme_options[featured_content_option]', array( 'choices' => $choices, 'label' => __( 'Enable Featured Content on', 'automobile' ), 'priority' => '1', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_option]', 'type' => 'select', ) ); $wp_customize->add_setting( 'automobile_theme_options[featured_content_layout]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_layout'], 'sanitize_callback' => 'automobile_sanitize_select', ) ); $automobile_featured_content_layout_options = automobile_featured_content_layout_options(); $choices = array(); foreach ( $automobile_featured_content_layout_options as $automobile_featured_content_layout_option ) { $choices[$automobile_featured_content_layout_option['value']] = $automobile_featured_content_layout_option['label']; } $wp_customize->add_control( 'automobile_theme_options[featured_content_layout]', array( 'active_callback' => 'automobile_is_featured_content_active', 'choices' => $choices, 'label' => __( 'Select Featured Content Layout', 'automobile' ), 'priority' => '2', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_layout]', 'type' => 'select', ) ); $wp_customize->add_setting( 'automobile_theme_options[featured_content_position]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_position'], 'sanitize_callback' => 'automobile_sanitize_checkbox' ) ); $wp_customize->add_control( 'automobile_theme_options[featured_content_position]', array( 'active_callback' => 'automobile_is_featured_content_active', 'label' => __( 'Check to Move above Footer', 'automobile' ), 'priority' => '3', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_position]', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'automobile_theme_options[featured_content_type]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_type'], 'sanitize_callback' => 'automobile_sanitize_select', ) ); $automobile_featured_content_types = automobile_featured_content_types(); $choices = array(); foreach ( $automobile_featured_content_types as $automobile_featured_content_type ) { $choices[$automobile_featured_content_type['value']] = $automobile_featured_content_type['label']; } $wp_customize->add_control( 'automobile_theme_options[featured_content_type]', array( 'active_callback' => 'automobile_is_featured_content_active', 'choices' => $choices, 'label' => __( 'Select Content Type', 'automobile' ), 'priority' => '3', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_type]', 'type' => 'select', ) ); $wp_customize->add_setting( 'automobile_theme_options[featured_content_headline]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_headline'], 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( 'automobile_theme_options[featured_content_headline]' , array( 'active_callback' => 'automobile_is_featured_content_active', 'description' => __( 'Leave field empty if you want to remove Headline', 'automobile' ), 'label' => __( 'Headline for Featured Content', 'automobile' ), 'priority' => '4', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_headline]', 'type' => 'text', ) ); $wp_customize->add_setting( 'automobile_theme_options[featured_content_subheadline]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_subheadline'], 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( 'automobile_theme_options[featured_content_subheadline]' , array( 'active_callback' => 'automobile_is_featured_content_active', 'description' => __( 'Leave field empty if you want to remove Sub-headline', 'automobile' ), 'label' => __( 'Sub-headline for Featured Content', 'automobile' ), 'priority' => '5', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_subheadline]', 'type' => 'text', ) ); $wp_customize->add_setting( 'automobile_theme_options[featured_content_number]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_number'], 'sanitize_callback' => 'automobile_sanitize_number_range', ) ); $wp_customize->add_control( 'automobile_theme_options[featured_content_number]' , array( 'active_callback' => 'automobile_is_demo_featured_content_inactive', 'description' => __( 'Save and refresh the page if No. of Featured Content is changed (Max no of Featured Content is 20)', 'automobile' ), 'input_attrs' => array( 'style' => 'width: 45px;', 'min' => 0, 'max' => 20, 'step' => 1, ), 'label' => __( 'No of Featured Content', 'automobile' ), 'priority' => '6', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_number]', 'type' => 'number', 'transport' => 'postMessage' ) ); $wp_customize->add_setting( 'automobile_theme_options[featured_content_show]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['featured_content_show'], 'sanitize_callback' => 'automobile_sanitize_select', ) ); $automobile_featured_content_show = automobile_featured_content_show(); $choices = array(); foreach ( $automobile_featured_content_show as $automobile_featured_content_shows ) { $choices[$automobile_featured_content_shows['value']] = $automobile_featured_content_shows['label']; } $wp_customize->add_control( 'automobile_theme_options[featured_content_show]', array( 'active_callback' => 'automobile_is_demo_featured_content_inactive', 'choices' => $choices, 'label' => __( 'Display Content', 'automobile' ), 'priority' => '6.1', 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_show]', 'type' => 'select', ) ); //loop for featured page sliders for ( $i=1; $i <= $options['featured_content_number'] ; $i++ ) { $wp_customize->add_setting( 'automobile_theme_options[featured_content_page_'. $i .']', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'automobile_sanitize_page', ) ); $wp_customize->add_control( 'automobile_featured_content_page_'. $i .'', array( 'active_callback' => 'automobile_is_featured_page_content_active', 'label' => __( 'Featured Page', 'automobile' ) . ' ' . $i , 'priority' => '5' . $i, 'section' => 'automobile_featured_content_settings', 'settings' => 'automobile_theme_options[featured_content_page_'. $i .']', 'type' => 'dropdown-pages', ) ); } // Featured Content Setting End