Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tomhemsley/9504185 to your computer and use it in GitHub Desktop.
Save tomhemsley/9504185 to your computer and use it in GitHub Desktop.
/**
* INSTALLATION: this code should be pasted into your theme's functions.php file.
*
* USAGE:
* Install 'Responsive Lightbox'.
* Add an image slide to your Meta Slider slideshow and enter the Vimeo URL in the URL field
*/
function metaslider_respoonsive_lightbox_vimeo($attributes, $slide, $slider_id) {
if (strpos($attributes['href'], 'vimeo.com') !== false) {
$attributes['rel'] = "lightbox-video-{$slide['id']}";
}
return $attributes;
}
add_filter('metaslider_flex_slider_anchor_attributes', 'metaslider_respoonsive_lightbox_vimeo', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment