Filter for wp_embed_handler_youtube not working


In WordPress 4.0, if I create a new post and paste a YouTube link directly into the post editor, WordPress will automatically convert it to a YouTube embed tag. I’m trying to edit the default output for the embed tag with a filter function.

I have a snippet set up like this:

add_action( 'wp_embed_handler_youtube', 'bigger_youtube_embeds', 10, 4);
function bigger_youtube_embeds($embed, $attr, $url, $rawattr) {
    // alter the $embed string...
    return $embed;

I tried this after viewing the following documentation:

My filter function never runs, though, and I’m not even sure when it is supposed to run.

, eterps 7 years 2014-12-09T17:35:38-05:00 0 Answers 70 views 0

Leave an answer