Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_the_post_thumbnail_src( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) {
- global $id;
- $post_id = ( NULL === $post_id ) ? $id : $post_id;
- $post_thumbnail_id = get_post_thumbnail_id( $post_id );
- $size = apply_filters( 'post_thumbnail_size', $size );
- if ( $post_thumbnail_id ) {
- 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
- $src = wp_get_attachment_image_src( $post_thumbnail_id, $size, false, $attr );
- do_action( 'end_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size );
- } else {
- $src = '';
- }
- return $src[0];
- }
- ?>
Add Comment
Please, Sign In to add comment