Use this filter to modify the JavaScript properties used to initiate the slideshow.
MetaSlider exposes most of each slideshows options in the slideshow settings, but there are some specialist options that are offered by each slideshow library that you cannot change through the MetaSlider interface. This filter allows you to change existing properties or add new ones.
For a full list of available properties, see Flex Slider Properties, Nivo Slider Properties (scroll down to ‘Play with settings’), Coin Slider Properties (scroll down to ‘List of all options’), Responsive Slides Properties (scroll down to ‘Options you can customise’)
Important:
{type} can be flex, coin, responsive or nivo.
$options
(array) (required) Slideshow properties
$slider_id
(array) (required) Slideshow ID
$settings
(int) (required) Slideshow settings
function metaslider_flex_params($options, $slider_id, $settings) {
if ($slider_id == 123) { // check for slider ID (optional)
$options['startAt'] = 2; // startAt: 2
$options['animationLoop'] = "false"; // animationLoop: false
$options['namespace'] = "'flex-'"; // namespace: 'flex'
$options['start'][] = "alert('hello');"; // start: function() { alert('hello'); }
}
return $options;
}
add_filter('metaslider_flex_slider_parameters', 'metaslider_flex_params', 10, 3);
The above code will result in the following output:
$('#metaslider_123').flexslider({ [existing properties], startAt: 2, animationLoop: false, namespace: 'flex-', start: function(slider) { alert('hello'); } });
Create and publish WordPress slideshows in minutes… What are you waiting for?