Ticket #25229: post-thumbnail-template1.diff
| File post-thumbnail-template1.diff, 2.1 KB (added by , 13 years ago) |
|---|
-
wp-includes/post-thumbnail-template.php
85 85 function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) { 86 86 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; 87 87 $post_thumbnail_id = get_post_thumbnail_id( $post_id ); 88 /** 89 * Filters the post thumbnail size. 90 * 91 * @since 2.9.0 92 * 93 * @param string $size The size of a post thumbnail. 94 * @see get_the_post_thumbnail. 95 */ 88 96 $size = apply_filters( 'post_thumbnail_size', $size ); 89 97 if ( $post_thumbnail_id ) { 98 /** 99 * Before fetching the post thumbnail HTML. 100 * 101 * @since 2.9.0 102 * 103 * @param string $post_id Post ID. 104 * @param string $post_thumbnail_id The post thumbnail ID. 105 * @param string $size The size of a post thumbnail. 106 */ 90 107 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 91 108 if ( in_the_loop() ) 92 109 update_post_thumbnail_cache(); 93 110 $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); 111 /** 112 * After fetching the post thumbnail HTML. 113 * 114 * @since 2.9.0 115 * 116 * @param string $post_id Post ID. 117 * @param string $post_thumbnail_id The post thumbnail ID. 118 * @param string $size The size of a post thumbnail. 119 */ 94 120 do_action( 'end_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); 95 121 } else { 96 122 $html = ''; 97 123 } 124 /** 125 * Filters the post thumbnail HTML. 126 * 127 * @since 2.9.0 128 * 129 * @param string $html Gets the image attachment for the post thumbnail. 130 * @param string $post_id Post ID. 131 * @param string $post_thumbnail_id The post thumbnail ID. 132 * @param string $size The size of a post thumbnail. 133 * @param string $attr Optional. Query string of attributes. 134 */ 98 135 return apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr ); 99 136 }