whyisjake

Jake Spurlock

Jun 9th, 2010
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. function get_the_post_thumbnail_src( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) {
  2.    
  3.     global $id;
  4.     $post_id = ( NULL === $post_id ) ? $id : $post_id;
  5.     $post_thumbnail_id = get_post_thumbnail_id( $post_id );
  6.     $size = apply_filters( 'post_thumbnail_size', $size );
  7.     if ( $post_thumbnail_id ) {
  8.         do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters
  9.         $src = wp_get_attachment_image_src( $post_thumbnail_id, $size, false, $attr );
  10.         do_action( 'end_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size );
  11.     } else {
  12.         $src = '';
  13.     }
  14.     return $src[0];
  15. }
  16.  
  17. ?>
Add Comment
Please, Sign In to add comment