Title: kgvid_replace_video: filter request
Last modified: August 24, 2016

---

# kgvid_replace_video: filter request

 *  Resolved [samurai](https://wordpress.org/support/users/samurai/)
 * (@samurai)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/kgvid_replace_video-filter-request/)
 * Hello Kyle and thanks for a great plugin 🙂
 * May I request a filter to be added to kgvid_replace_video() just before the “
   return” statement.
 * Your code (for a documented reason) does not use wp_update_post() and instead
   calls $wpdb->update directly which breaks another plugin that I use.
    To resolve
   this I need to call clean_post_cache() just before the function returns and I’d
   really prefer not modifying your code.
 * Thanks for your help.
 * [https://wordpress.org/plugins/video-embed-thumbnail-generator/](https://wordpress.org/plugins/video-embed-thumbnail-generator/)

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

 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/kgvid_replace_video-filter-request/#post-5992267)
 * Thanks for bringing this to my attention. I feel like I should really make it
   work for everyone, not just people who know how to access filters. Can you give
   me more details about the other plugin and the conflict that calling $wpdb->update
   to change the GUID creates? There might be a simple solution that works with 
   an existing hook.
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/kgvid_replace_video-filter-request/#post-5992274)
 * Ok, here’s an idea: I’ll run wp_update_post to update the MIME type first, then
   only update the GUID with $wpdb->update. I assume it’s the MIME you’re having
   trouble with and you’re not doing anything with GUIDs?
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/kgvid_replace_video-filter-request/#post-5992279)
 * I’ll also add clean_post_cache() to the kgvid_replace_video function.
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/kgvid_replace_video-filter-request/#post-5992289)
 * Looks like I don’t need to call clean_post_cache() since wp_update_post() does
   it for me. I created an [issue on GitHub](https://github.com/kylegilman/video-embed-thumbnail-generator/issues/210)
   to track this change. It will be in the next release which I’m hoping to put 
   out in about a week. If you want you can try out the development version on GitHub.
   It’s pretty stable.
 *  Thread Starter [samurai](https://wordpress.org/support/users/samurai/)
 * (@samurai)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/kgvid_replace_video-filter-request/#post-5992292)
 * Hi Kyle – yes, if you call wp_update_post() there’s no need for a hook nor clean_post_cache().
 * Thanks for your prompt reply 🙂

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

The topic ‘kgvid_replace_video: filter request’ is closed to new replies.

 * ![](https://ps.w.org/video-embed-thumbnail-generator/assets/icon.svg?rev=2965979)
 * [Videopack](https://wordpress.org/plugins/video-embed-thumbnail-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/video-embed-thumbnail-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [samurai](https://wordpress.org/support/users/samurai/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/kgvid_replace_video-filter-request/#post-5992292)
 * Status: resolved