Advertisement
phpface

Untitled

May 17th, 2018
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1.  
  2. if( ! function_exists( 'videotube_filter_post_thumbnail_size' ) ){
  3.     /**
  4.      *
  5.      * Retrieving full thumbnail image for video posts
  6.      *
  7.      * @param string $size
  8.      * @param string $post_id
  9.      * @return string
  10.      *
  11.      * @since 1.0.0
  12.      *
  13.      */
  14.     function videotube_filter_post_thumbnail_size( $size, $post_id ) {
  15.         if( get_post_type( $post_id ) == 'video' ){
  16.             return 'full';
  17.         }
  18.         return $size;
  19.     }
  20.     add_filter( 'post_thumbnail_size' , 'videotube_filter_post_thumbnail_size', 9999, 2 );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement