*
 * @package Create
 * @subpackage Create Pro
 * @since Create 1.2.1
 */
// Featured Slider
$wp_customize->add_section('create_featured_slider', array('priority' => 500, 'title' => __('Featured Slider', 'create')));
$wp_customize->add_setting('featured_slider_option', array('capability' => 'edit_theme_options', 'default' => $defaults['featured_slider_option'], 'sanitize_callback' => 'sanitize_key'));
$featured_slider_content_options = create_featured_slider_options();
$choices = array();
foreach ($featured_slider_content_options as $featured_slider_content_option) {
    $choices[$featured_slider_content_option['value']] = $featured_slider_content_option['label'];
}
$wp_customize->add_control('featured_slider_option', array('choices' => $choices, 'label' => __('Enable Slider on', 'create'), 'priority' => '1.1', 'section' => 'create_featured_slider', 'settings' => 'featured_slider_option', 'type' => 'select'));
$wp_customize->add_setting('featured_slide_transition_effect', array('capability' => 'edit_theme_options', 'default' => $defaults['featured_slide_transition_effect'], 'sanitize_callback' => 'create_sanitize_select'));
$create_featured_slide_transition_effects = create_featured_slide_transition_effects();
$choices = array();
foreach ($create_featured_slide_transition_effects as $create_featured_slide_transition_effect) {
    $choices[$create_featured_slide_transition_effect['value']] = $create_featured_slide_transition_effect['label'];
}
$wp_customize->add_control('featured_slide_transition_effect', array('active_callback' => 'create_is_slider_active', 'choices' => $choices, 'label' => __('Transition Effect', 'create'), 'priority' => '2', 'section' => 'create_featured_slider', 'settings' => 'featured_slide_transition_effect', 'type' => 'select'));
$wp_customize->add_setting('featured_slide_transition_delay', array('capability' => 'edit_theme_options', 'default' => $defaults['featured_slide_transition_delay'], 'sanitize_callback' => 'absint', 'sanitize_callback' => 'create_sanitize_select'));
$wp_customize->add_control('featured_slide_transition_delay', array('active_callback' => 'create_is_slider_active', 'description' => __('seconds(s)', 'create'), 'input_attrs' => array('style' => 'width: 40px;'), 'label' => __('Transition Delay', 'create'), 'priority' => '2.1.1', 'section' => 'create_featured_slider', 'settings' => 'featured_slide_transition_delay'));
$wp_customize->add_setting('featured_slide_transition_length', array('capability' => 'edit_theme_options', 'default' => $defaults['featured_slide_transition_length'], 'sanitize_callback' => 'absint'));
$wp_customize->add_control('featured_slide_transition_length', array('active_callback' => 'create_is_slider_active', 'description' => __('seconds(s)', 'create'), 'input_attrs' => array('style' => 'width: 40px;'), 'label' => __('Transition Length', 'create'), 'priority' => '2.1.2', 'section' => 'create_featured_slider', 'settings' => 'featured_slide_transition_length'));
$wp_customize->add_setting('featured_slider_image_loader', array('capability' => 'edit_theme_options', 'default' => $defaults['featured_slider_image_loader'], 'sanitize_callback' => 'sanitize_key'));
$featured_slider_image_loader_options = create_featured_slider_image_loader();
$choices = array();
foreach ($featured_slider_image_loader_options as $featured_slider_image_loader_option) {
    $choices[$featured_slider_image_loader_option['value']] = $featured_slider_image_loader_option['label'];
}
Example #2
0
/**
 * Sanitizes feature slider transition effects
 * @param  $input entered value
 * @return sanitized output
 *
 * @since Create 1.2
 */
function create_sanitize_featured_slide_transition_effects($input)
{
    $create_featured_slide_transition_effects = array_keys(create_featured_slide_transition_effects());
    if (in_array($input, $create_featured_slide_transition_effects)) {
        return $input;
    } else {
        $defaults = create_get_default_theme_options();
        return $defaults['featured_slide_transition_effect'];
    }
}