Title: Need filter for iframe and embed code manipulation
Last modified: August 20, 2016

---

# Need filter for iframe and embed code manipulation

 *  Resolved [ThePres](https://wordpress.org/support/users/thepres/)
 * (@thepres)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation/)
 * Long story short: to support YouTube tracking we need the “enablejsapi” parameter
   to be true (1) in the YT embed code URL, we also need a way to reference the 
   iframe for example using the id attribute.
 * My suggestion is in the `get_the_post_video()` function located in **general.
   php** add a filter on the embed code and preferably also on the source URL. Ideally
   I’d like to be able to choose my own attributes and source parameters entirely
   but I guess it would be acceptable to manipulate the entire HTML as well.
 * As of now we must hardcode changes in the source code to get the intended behaviour,
   of which are of course overwritten on update.
 * Thanks,
    ThePres
 * [http://wordpress.org/extend/plugins/featured-video-plus/](http://wordpress.org/extend/plugins/featured-video-plus/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Alex](https://wordpress.org/support/users/ahoereth/)
 * (@ahoereth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation/#post-3617895)
 * Hey ThePres,
    thanks for reporting. I recommend hard coding it for the moment(`
   php/general.php`) – will add an ID and the enablejsapi parameter to the media
   settings with the next update.
 * Not sure which other parameters you would need? I guess I already added most 
   of them to the settings.
    Alex
 *  Thread Starter [ThePres](https://wordpress.org/support/users/thepres/)
 * (@thepres)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation/#post-3617896)
 * Hi Alex, thanks for the quick response.
 * I guess your suggested changes would handle my immediate case, just figured it’s
   more flexible if one could change/add/delete attributes or parameters on demand
   instead of it having to go through the development process everytime.
 * The filter on embed code would be very handy btw, in the ideal world I’d like
   to print some HTML/script code together with the embedded video.
 *  Plugin Author [Alex](https://wordpress.org/support/users/ahoereth/)
 * (@ahoereth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation/#post-3617935)
 * Thanks for the suggestions.
    I guess the objective of the plugin is to replace
   featured images without any hassle and make the videos simply fit the existing
   layout. I already use a `div` around the embed/iframe which then can be customized
   using CSS and the media settings. Still, I will consider adding a filter. If 
   you like I really would appreciate a rating for the plugin. Alex
 *  Plugin Author [Alex](https://wordpress.org/support/users/ahoereth/)
 * (@ahoereth)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation/#post-3617957)
 * Hey ThePres,
    the Plugin now features a filter, iframe id for YouTube videos,
   enablejsapi and playerapiid paramters. Everything works fine? Alex
 *  Thread Starter [ThePres](https://wordpress.org/support/users/thepres/)
 * (@thepres)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation/#post-3617958)
 * Hi Alex, thank you very much.
 * Ideally I’d prefer if the `$meta['prov']` value was given as an argument to the
   filter so I could more reliably detect if the video is a youtube video, but I
   got it working fine for now. Either way this is 100 times better than having 
   to hardcode the values in your plugin files 🙂
 * I must admit I’m a bit surprised you actively support people here. I will surely
   rate your plugin 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Need filter for iframe and embed code manipulation’ is closed to new 
replies.

 * ![](https://ps.w.org/featured-video-plus/assets/icon.svg?rev=1170997)
 * [Featured Video Plus](https://wordpress.org/plugins/featured-video-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/featured-video-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/featured-video-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/featured-video-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/featured-video-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/featured-video-plus/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [ThePres](https://wordpress.org/support/users/thepres/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation/#post-3617958)
 * Status: resolved