Created
June 6, 2014 04:19
-
-
Save designbuildtest/70e6f9895630f64560bc to your computer and use it in GitHub Desktop.
Slider autoplay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Slider autoplay toggle. | |
$wp_customize->add_setting( 'slider_autoplay', array( | |
'default' => 'disabled', | |
'sanitize_callback' => 'twentyfourteen_sanitize_slider_autoplay', | |
) ); | |
$wp_customize->add_control( 'slider_autoplay', array( | |
'label' => __( 'Slider Autoplay', 'twentyfourteen' ), | |
'section' => 'featured_content', | |
'type' => 'select', | |
'choices' => array( | |
'disabled' => __( 'Disabled', 'twentyfourteen' ), | |
'enabled' => __( 'Enabled', 'twentyfourteen' ), | |
), | |
'priority' => 2, | |
) ); | |
/** | |
* Sanitize the Slider Autoplay value. | |
* | |
* @since Twenty Fourteen 1.0 | |
* | |
* @param string $layout Layout type. | |
* @return string Filtered autoplay value (disabled|enabled). | |
*/ | |
function twentyfourteen_sanitize_slider_autoplay( $autoplay ) { | |
if ( ! in_array( $autoplay, array( 'disabled', 'enabled' ) ) ) { | |
$autoplay = 'disabled'; | |
} | |
return $autoplay; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment