From 3dcb347d7fee4dcf30a3db7d44d50ffb203bd6d7 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Mon, 11 Jun 2012 21:50:27 -0600 Subject: [PATCH] Wrap embedded media as suggested by Readability --- inc/cleanup.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/inc/cleanup.php b/inc/cleanup.php index e4a0ded..2bf1cee 100644 --- a/inc/cleanup.php +++ b/inc/cleanup.php @@ -708,3 +708,16 @@ function roots_widget_first_last_classes($params) { } add_filter('dynamic_sidebar_params', 'roots_widget_first_last_classes'); + +/** + * Wrap embedded media as suggested by Readability + * + * @link https://gist.github.com/965956 + * @link http://www.readability.com/publishers/guidelines#publisher + */ +function roots_embed_wrap($cache, $url, $attr = '', $post_ID = '') { + return '
' . $cache . '
'; +} + +add_filter('embed_oembed_html', 'roots_embed_wrap', 10, 4); +add_filter('embed_googlevideo', 'roots_embed_wrap', 10, 2);