Created
July 2, 2014 02:40
-
-
Save galbaras/efec7adc266db3b40699 to your computer and use it in GitHub Desktop.
Embedded video notice for emailed feeds
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
function add_rss_video_embed_notice( $html, $url, $attr, $post_id ) { | |
if (!is_feed()) { // No need to change anything | |
return $html; | |
} | |
$permalink = get_permalink( $post_id ); | |
$notice = '<br /><small>If you cannot see a video, <a href="' . $permalink . '">view this post online</a></small>'; | |
return $html . $notice; | |
} | |
add_filter( 'embed_oembed_html', 'add_rss_video_embed_notice', 100, 4 ); // If doesn't work, increase priority from 100 to higher number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment