Skip to content

Instantly share code, notes, and snippets.

@tomhemsley
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomhemsley/c7f13eafa3b28833f078 to your computer and use it in GitHub Desktop.
Save tomhemsley/c7f13eafa3b28833f078 to your computer and use it in GitHub Desktop.
Meta Slider - Add poster attribute to video
function add_poster_to_video( $atts, $slide_id, $slider_id, $settings, $url ) {
$atts['poster'] = $url;
unset($atts['autoplay']); // stop video auto playing
return $atts;
}
add_filter('metaslider_layer_video_attributes','add_poster_to_video', 10, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment