Ticket #11571: 11571.4.diff
File 11571.4.diff, 1.6 KB (added by , 10 years ago) |
---|
-
post-thumbnail-template.php
83 83 * @since 2.9.0 84 84 * 85 85 * @param int $post_id Optional. Post ID. 86 * @param string $size Optional. Image size. Defaults to ' thumbnail'.86 * @param string $size Optional. Image size. Defaults to 'post-thumbnail'. 87 87 * @param string|array $attr Optional. Query string or array of attributes. 88 88 */ 89 89 function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) { 90 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;91 90 $post_thumbnail_id = get_post_thumbnail_id( $post_id ); 92 91 $size = apply_filters( 'post_thumbnail_size', $size ); 93 92 if ( $post_thumbnail_id ) { … … 102 101 return apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr ); 103 102 } 104 103 104 /** 105 * Retrieve Post Thumbnail URL 106 * 107 * @param int $post_id Optional. Post ID. 108 * @param string $size Optional. Image size. Defaults to 'post-thumbnail'. 109 * @return string|bool Image src, or false if the post does not have a thumbnail. 110 */ 111 function get_the_post_thumbnail_src( $post_id = null, $size = 'post-thumbnail' ) { 112 $post_thumbnail_id = get_post_thumbnail_id( $post_id ); 113 114 if ( ! $post_thumbnail_id ) { 115 return FALSE; 116 117 if ( in_the_loop() ) 118 update_post_thumbnail_cache(); 119 $size = apply_filters( 'post_thumbnail_size', $size ); 120 list( $src ) = wp_get_attachment_image_src( $post_thumbnail_id, $size, false ); 121 122 return $src; 123 } 124 105 125 ?>