Skip to content

Instantly share code, notes, and snippets.

@galbaras
Created July 2, 2014 02:40
Show Gist options
  • Save galbaras/efec7adc266db3b40699 to your computer and use it in GitHub Desktop.
Save galbaras/efec7adc266db3b40699 to your computer and use it in GitHub Desktop.
Embedded video notice for emailed feeds
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