Advertisement
phpface

Untitled

Sep 5th, 2018
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. if( ! function_exists( 'videotube_pull_full_thumbnail_size' ) ){
  2.     /**
  3.      * Pull full video thumbnail image
  4.      *
  5.      * @param string $size
  6.      * @return string full
  7.      */
  8.     function videotube_pull_full_thumbnail_size( $size ) {
  9.         global $post;
  10.        
  11.         $image = wp_get_attachment_image_url( get_post_thumbnail_id( $post ) );
  12.        
  13.         if( $image ){
  14.             $check_file = wp_check_filetype( $image );
  15.             if( $check_file['ext'] == 'gif' ){
  16.                 $size = 'full';
  17.             }
  18.         }
  19.         return $size;
  20.     }
  21.    
  22.     add_filter( 'video_thumbnail_size' , 'videotube_pull_full_thumbnail_size', 10, 1 );
  23.     add_filter( 'post_thumbnail_size' , 'videotube_pull_full_thumbnail_size', 10 );
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement