I created a slider in wordpress and for ther transition effects I have used the select field of the redux framework.
I checked the article here
but Im not sure why is not working. below is the field that I have created in redux config
array(
'id' => 'slide-transition',
'type' => 'select',
'multi' => true,
'title' => __('Slide Transition Effects', 'gazi'),
'subtitle' => __('Choose the transition effects for the slides, you can also use all effects together.', 'gazi'),
'options' => array('slide' => __('Slide','gazi'), 'elastic' => __('Elastic','gazi'), 'fade' => __('Fade','gazi'), 'blocks' => __('Blocks','gazi')), //Must provide key => value pairs for select options
'default' => array('slide','elastic','fade','blocks')
),
output:
global $gazment;
$slide_transition = isset( $gazment['slide-transition'] ) ? $gazment['slide-transition'] : null;
if( !is_array( $slide_transition ) ){
$slide_transition = (array)$slide_transition;
}
and the out put in javascriptis:
},
transition:"<?php echo $slide_transition; ?>",
scalemode:"fill",
isfullscreen:false,
textformat: {
}
but it doesnt work because when i see the page source its something like this transition:"Array",
I dont know what Im doing wrong, I need to get the selected elements with commas like:transition:"slide,elastic,fade,blocks",
how can I fix this?
any help will be very appreciated
I have resolved using in array like the code below
transition:"<?php if (in_array('slide', $slide_transition)) { echo 'slide,'; } if (in_array('elastic', $slide_transition)) { echo 'elastic,'; } if (in_array('fade', $slide_transition)) { echo 'fade,'; } if (in_array('blocks', $slide_transition)) { echo 'blocks,'; } ?>", scalemode:"fill",isfullscreen:false, textformat: {}
thanks to php.net :) http://php.net/manual/en/function.in-array.php