Created
July 17, 2014 04:19
-
-
Save jocastaneda/832d8771380df6ad98e1 to your computer and use it in GitHub Desktop.
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
add_action( 'customize_register', 'slug_customizer' ); | |
function slug_customizer( $customizer ){ | |
$sliders = array(); | |
if ( class_exists( 'Soliloquy_Lite' ) || class_exists( 'Soliloquy' ) ) | |
$sliders['soliloquy'] = 'Soliloquy'; | |
if ( class_exists( 'MetaSliderPlugin' ) ) | |
$sliders['metaslider'] = 'Meta Slider'; | |
if( !empty( $sliders ) ){ | |
$customizer->add_section( 'slider_selection', array( | |
'title' => __( 'Slider selection', 'slug' ), | |
'description' => __( 'Use an id and the slider ( if more than one )', 'slug' ), | |
'priority' => 21 ) ); | |
$customizer->add_setting( 'slider_name', array( | |
'default' => '' ) ); | |
$customizer->add_setting( 'slider_id', array( | |
'default' => '' ) ); | |
// setup select choices | |
foreach( $sliders as $slider => $name ){ | |
$choices[ $slider ] = __( "$name", 'slug' ); | |
} | |
$customizer->add_control( 'slider_name', array( | |
'label' => __( 'Choose a slider', 'slug' ), | |
'section' => 'slider_selection', | |
'type' => 'select', | |
'choices' => $choices ) ); | |
$customizer->add_control( 'slider_id', array( | |
'label' => __( 'Use the slider ID', 'slug' ), | |
'section' => 'slider_selection', | |
'type' => 'text' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment