Skip to content

Instantly share code, notes, and snippets.

@juanjosezg
Created June 11, 2022 02:09
Show Gist options
  • Save juanjosezg/d44850e78cd2959340f3c94e0c27fe11 to your computer and use it in GitHub Desktop.
Save juanjosezg/d44850e78cd2959340f3c94e0c27fe11 to your computer and use it in GitHub Desktop.
Add Wrapper to Youtube Embed
add_filter('oembed_dataparse','oembed_youtube_add_wrapper',10,3);
function oembed_youtube_add_wrapper($return, $data, $url) {
if ($data->provider_name == 'YouTube') {
return "<div class='youtube-wrapper'>{$return}</div>";
} else {
return $return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment