Hi all!
My idea is to improve the plugin to have several attributes in the shortcode, that I could pass to the FlexSlider js param array.
I'm trying to pass [gallery slideshow="auto"].
Here's the code:
//member of class MV_Gallery_To_Slideshow
function set_slideshow( $params, $attr ){
switch($attr["slideshow"]) {
case "auto":
$params['slideshow'] = true;
break;
default:
$params['slideshow'] = false;
}
return $params;
}
....
function enqueue_script() {
...
add_filter( 'mv_gallery_to_slideshow_attr', 'set_slideshow', 10, 2 );
wp_localize_script( 'gallery-to-slideshow', 'mv_gallery_to_slideshow_js_params', apply_filters( 'mv_gallery_to_slideshow_js_params', $params ) );
}
What am I doing wrong, please?