Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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