We understand developer's need, Super Carousel is built with many actions and filters, that makes customization possible.
Action "SuperCarousel_Before" And "SuperCarousel_After"
These actions are called before and after all the carousels.
Check below code.
add_action(‘SuperCarousel_Before’, ‘example_methodname’);
add_action(‘SuperCarousel_After’, ‘example_methodname’);
function example_methodname($carouselId=0) {
//Do your stuff
}
If you need this for specific carousel, append the Carousel Id after the action.
add_action(‘SuperCarousel_Before_[ID]’, ‘example_methodname’);
add_action(‘SuperCarousel_After_[ID]’, ‘example_methodname’);
function example_methodname() {
//Do your stuff
}
To filter pre-defined variables, use below code.
add_filter(‘SuperCarousel_[type]_[variable]’, ‘example_methodname’, 10, 2);
Possible values of “type” are “Image”, “Content”, “Post”, “YouTube”, “Feeds” and “Flickr”.
add_filter(‘SuperCarousel_Image_title’, ‘example_methodname’, 10, 2);
function example_methodname($data=[]) {
//Do your stuff
return $data[‘caption’];
}
To filter specific carousel and write custom code, use below filter
add_filter(‘SuperCarousel_[ID]’, ‘example_methodname’, 10, 2);
function example_methodname($type, $data=[]) {
//Do your stuff
return $html;
}
To apply filter to carousels, use below code.
add_filter(‘SuperCarousel’, ‘example_methodname’, 10, 3);
function example_methodname($carouselId, $type, $data=[]) {
//Do your stuff
return $html;
}