Home › Forums › Other › Issue with WordPress embed_oembed_html › Reply To: Issue with WordPress embed_oembed_html
January 16, 2016 at 2:19 pm
#236892
vandigroup
Participant
The only issue with the original code here is that you need to return $cache rather than $html. The correct code would be:
add_filter('embed_oembed_html', 'custom_youtube_settings', 99, 4);
function custom_youtube_settings($cache, $url, $attr, $post_id) {
return '<div class="embed-responsive embed-responsive-16by9">' . $cache . '</div>';
}