Skip to main content
edited body
Source Link
Otto
  • 32.8k
  • 1
  • 66
  • 109

Make a custom plugin for your site, put this code in it.

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='whatever'>{$return}</div>";
    } else {
        return $return;
    }
}

Note: The filter runs when the data is gathered from the oembed provider. So, itif you already embedded the post, and the embed data is cached, this won't modify it.

Make a custom plugin for your site, put this code in it.

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='whatever'>{$return}</div>";
    } else {
        return $return;
    }
}

Note: The filter runs when the data is gathered from the oembed provider. So, it you already embedded the post, and the embed data is cached, this won't modify it.

Make a custom plugin for your site, put this code in it.

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='whatever'>{$return}</div>";
    } else {
        return $return;
    }
}

Note: The filter runs when the data is gathered from the oembed provider. So, if you already embedded the post, and the embed data is cached, this won't modify it.

added 171 characters in body
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244

Make a custom plugin for your site, put this code in it.

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='whatever'>{$return}</div>";
    } else {
        return $return;
    }
}

Note: The filter runs when the data is gathered from the oembed provider. So, it you already embedded the post, and the embed data is cached, this won't modify it.

Make a custom plugin for your site, put this code in it.

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='whatever'>{$return}</div>";
    } else {
        return $return;
    }
}

Make a custom plugin for your site, put this code in it.

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='whatever'>{$return}</div>";
    } else {
        return $return;
    }
}

Note: The filter runs when the data is gathered from the oembed provider. So, it you already embedded the post, and the embed data is cached, this won't modify it.

Source Link
Otto
  • 32.8k
  • 1
  • 66
  • 109

Make a custom plugin for your site, put this code in it.

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='whatever'>{$return}</div>";
    } else {
        return $return;
    }
}