Created
June 11, 2022 02:09
-
-
Save juanjosezg/d44850e78cd2959340f3c94e0c27fe11 to your computer and use it in GitHub Desktop.
Add Wrapper to Youtube Embed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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