| 105 | /** |
| 106 | * Retrieve Post Thumbnail URL |
| 107 | * |
| 108 | * @param int $post_id Optional. Post ID. |
| 109 | * @param string $size Optional. Image size. Defaults to 'post-thumbnail'. |
| 110 | */ |
| 111 | function get_the_post_thumbnail_src( $post_id = null, $size = 'post-thumbnail' ) { |
| 112 | $post_id = ( NULL === $post_id ) ? get_the_ID() : $post_id; |
| 113 | $post_thumbnail_id = get_post_thumbnail_id( $post_id ); |
| 114 | |
| 115 | if ( $post_thumbnail_id ) { |
| 116 | if ( in_the_loop() ) |
| 117 | update_post_thumbnail_cache(); |
| 118 | $size = apply_filters( 'post_thumbnail_size', $size ); |
| 119 | list( $src ) = wp_get_attachment_image_src( $post_thumbnail_id, $size, false ); |
| 120 | } else { |
| 121 | $src = FALSE; |
| 122 | } |
| 123 | return $src; |
| 124 | } |
| 125 | |