get_bloginfo( 'version' ) ) { $wp_customize->add_panel( 'automobile_news_ticker_options', array( 'capability' => 'edit_theme_options', 'description' => __( 'News Ticker Options', 'automobile' ), 'priority' => 400, 'title' => __( 'News Ticker', 'automobile' ), ) ); $wp_customize->add_section( 'automobile_news_ticker_settings', array( 'panel' => 'automobile_news_ticker_options', 'priority' => 1, 'title' => __( 'News Ticker Options', 'automobile' ), ) ); } else { $wp_customize->add_section( 'automobile_news_ticker_settings', array( 'priority' => 400, 'title' => __( 'News Ticker', 'automobile' ), ) ); } $wp_customize->add_setting( 'automobile_theme_options[news_ticker_option]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['news_ticker_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[news_ticker_option]', array( 'choices' => $choices, 'label' => __( 'Enable News Ticker on', 'automobile' ), 'priority' => '1', 'section' => 'automobile_news_ticker_settings', 'settings' => 'automobile_theme_options[news_ticker_option]', 'type' => 'select', ) ); $wp_customize->add_setting( 'automobile_theme_options[news_ticker_position]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['news_ticker_position'], 'sanitize_callback' => 'automobile_sanitize_select', ) ); $automobile_news_ticker_positions = automobile_news_ticker_positions(); $choices = array(); foreach ( $automobile_news_ticker_positions as $automobile_news_ticker_position ) { $choices[$automobile_news_ticker_position['value']] = $automobile_news_ticker_position['label']; } $wp_customize->add_control( 'automobile_theme_options[news_ticker_position]', array( 'active_callback' => 'automobile_is_news_ticker_active', 'choices' => $choices, 'label' => __( 'News Ticker Position', 'automobile' ), 'priority' => '3', 'section' => 'automobile_news_ticker_settings', 'settings' => 'automobile_theme_options[news_ticker_position]', 'type' => 'select', ) ); $wp_customize->add_setting( 'automobile_theme_options[news_ticker_transition_effect]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['news_ticker_transition_effect'], 'sanitize_callback' => 'automobile_sanitize_select', ) ); $automobile_news_ticker_transition_effects = automobile_featured_slide_transition_effects(); $choices = array(); foreach ( $automobile_news_ticker_transition_effects as $automobile_news_ticker_transition_effect ) { $choices[$automobile_news_ticker_transition_effect['value']] = $automobile_news_ticker_transition_effect['label']; } $wp_customize->add_control( 'automobile_theme_options[news_ticker_transition_effect]' , array( 'active_callback' => 'automobile_is_news_ticker_active', 'choices' => $choices, 'label' => __( 'Transition Effect', 'automobile' ), 'priority' => '4', 'section' => 'automobile_news_ticker_settings', 'settings' => 'automobile_theme_options[news_ticker_transition_effect]', 'type' => 'select', ) ); $wp_customize->add_setting( 'automobile_theme_options[news_ticker_type]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['news_ticker_type'], 'sanitize_callback' => 'automobile_sanitize_select', ) ); $automobile_news_ticker_types = automobile_news_ticker_types(); $choices = array(); foreach ( $automobile_news_ticker_types as $automobile_news_ticker_type ) { $choices[$automobile_news_ticker_type['value']] = $automobile_news_ticker_type['label']; } $wp_customize->add_control( 'automobile_theme_options[news_ticker_type]', array( 'active_callback' => 'automobile_is_news_ticker_active', 'choices' => $choices, 'label' => __( 'Select Ticker Type', 'automobile' ), 'priority' => '3', 'section' => 'automobile_news_ticker_settings', 'settings' => 'automobile_theme_options[news_ticker_type]', 'type' => 'select', ) ); $wp_customize->add_setting( 'automobile_theme_options[news_ticker_label]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['news_ticker_label'], 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( 'automobile_theme_options[news_ticker_label]' , array( 'active_callback' => 'automobile_is_demo_news_ticker_inactive', 'description' => __( 'Leave field empty if you want to remove Headline', 'automobile' ), 'label' => __( 'News Ticker Label', 'automobile' ), 'priority' => '4', 'section' => 'automobile_news_ticker_settings', 'settings' => 'automobile_theme_options[news_ticker_label]', 'type' => 'text', ) ); $wp_customize->add_setting( 'automobile_theme_options[news_ticker_number]', array( 'capability' => 'edit_theme_options', 'default' => $defaults['news_ticker_number'], 'sanitize_callback' => 'automobile_sanitize_number_range', ) ); $wp_customize->add_control( 'automobile_theme_options[news_ticker_number]' , array( 'active_callback' => 'automobile_is_demo_news_ticker_inactive', 'description' => __( 'Save and refresh the page if No. of News Ticker is changed (Max no of News Ticker is 20)', 'automobile' ), 'input_attrs' => array( 'style' => 'width: 45px;', 'min' => 0, 'max' => 20, 'step' => 1, ), 'label' => __( 'No of News Ticker', 'automobile' ), 'priority' => '6', 'section' => 'automobile_news_ticker_settings', 'settings' => 'automobile_theme_options[news_ticker_number]', 'type' => 'number', 'transport' => 'postMessage' ) ); for ( $i=1; $i <= $options['news_ticker_number'] ; $i++ ) { //Page News Ticker $wp_customize->add_setting( 'automobile_theme_options[news_ticker_page_'. $i .']', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'automobile_sanitize_page', ) ); $wp_customize->add_control( 'automobile_news_ticker_page_'. $i .'', array( 'active_callback' => 'automobile_is_page_news_ticker_active', 'label' => __( 'Page', 'automobile' ) . ' ' . $i , 'section' => 'automobile_news_ticker_settings', 'settings' => 'automobile_theme_options[news_ticker_page_'. $i .']', 'type' => 'dropdown-pages', ) ); } // News Ticker Setting End