Title: post format filter
Last modified: August 21, 2016

---

# post format filter

 *  Resolved [nata-lee](https://wordpress.org/support/users/nata-lee/)
 * (@nata-lee)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/post-format-filter/)
 * Hello, this is a very nice and useful plugin!
 * I need to make featured image from video thumbnails only for video post format.
   In the settings page there is only a post type option, and there is no post format
   option. I didn’t find this filter at the PRO version of the product.
 * Could you, please, include this option?
 * The workaround I use now is to change 296 line at the video-thumbnails.php:
    `
   if ( $this->settings->options['set_featured'] == 1 && $this->settings->options['
   save_media'] == 1 && has_post_format('video') ) {`
 * [https://wordpress.org/plugins/video-thumbnails/](https://wordpress.org/plugins/video-thumbnails/)

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

 *  Plugin Author [Sutherland Boswell](https://wordpress.org/support/users/sutherlandboswell/)
 * (@sutherlandboswell)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/post-format-filter/#post-5057779)
 * I may add this option eventually, but I’d need to consider hiding the meta box
   on the fly when the post format is changed.
 *  Thread Starter [nata-lee](https://wordpress.org/support/users/nata-lee/)
 * (@nata-lee)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/post-format-filter/#post-5057815)
 * Hello! Have you any plan to add the option? Or filter that I could use in my 
   functions.php? It’s no good to change the code of the plugin at any update.
 *  Plugin Author [Sutherland Boswell](https://wordpress.org/support/users/sutherlandboswell/)
 * (@sutherlandboswell)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/post-format-filter/#post-5057816)
 * Unfortunately I haven’t had any time to focus on this feature, but I do hope 
   to include it one day.
 * The good news is that I do have a solution for you to use in your functions.php
   file. I have not tested it, but I think it will work:
 *     ```
       function limit_video_thumbnails_to_post_format( $markup, $post_id ) {
       	if ( has_post_format( 'video', $post_id ) ) {
       		$markup = '';
       	}
           return $markup;
       }
   
       add_filter( 'video_thumbnail_markup', 'limit_video_thumbnails_to_post_format', 10, 2 );
       ```
   
 *  Thread Starter [nata-lee](https://wordpress.org/support/users/nata-lee/)
 * (@nata-lee)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/post-format-filter/#post-5057822)
 * Hello!
 * Thanks for the filter!!
 * But the code has a typo, an exclamation before has_post_format is needed, because
   we need to set an empty markup for posts which are NOT videos.
 *     ```
       function limit_video_thumbnails_to_post_format( $markup, $post_id ) {
       	if ( !has_post_format( 'video', $post_id ) ) {
       		$markup = '';
       	}
           return $markup;
       }
   
       add_filter( 'video_thumbnail_markup', 'limit_video_thumbnails_to_post_format', 10, 2 );
       ```
   
 * Thank you!
    I’m going to test it for a while.
 *  Plugin Author [Sutherland Boswell](https://wordpress.org/support/users/sutherlandboswell/)
 * (@sutherlandboswell)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/post-format-filter/#post-5057823)
 * Oops, glad you were able to figure that out!

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

The topic ‘post format filter’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/video-thumbnails_3e6f7f.svg)
 * [Video Thumbnails](https://wordpress.org/plugins/video-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/video-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/video-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/video-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/video-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/video-thumbnails/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Sutherland Boswell](https://wordpress.org/support/users/sutherlandboswell/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/post-format-filter/#post-5057823)
 * Status: resolved