Changeset 25513
- Timestamp:
- 09/20/2013 02:50:35 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-thumbnail-template.php
r23227 r25513 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 /** 90 * Filter the post thumbnail size. 91 * 92 * @since 2.9.0 93 * 94 * @param string $size The post thumbnail size. 95 */ 88 96 $size = apply_filters( 'post_thumbnail_size', $size ); 97 89 98 if ( $post_thumbnail_id ) { 90 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 99 100 /** 101 * Fires before fetching the post thumbnail HTML. 102 * 103 * Provides "just in time" filtering of all filters in wp_get_attachment_image(). 104 * 105 * @since 2.9.0 106 * 107 * @param string $post_id The post ID. 108 * @param string $post_thumbnail_id The post thumbnail ID. 109 * @param string $size The post thumbnail size. 110 */ 111 do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); 91 112 if ( in_the_loop() ) 92 113 update_post_thumbnail_cache(); 93 114 $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); 115 116 /** 117 * Fires after fetching the post thumbnail HTML. 118 * 119 * @since 2.9.0 120 * 121 * @param string $post_id The post ID. 122 * @param string $post_thumbnail_id The post thumbnail ID. 123 * @param string $size The post thumbnail size. 124 */ 94 125 do_action( 'end_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); 126 95 127 } else { 96 128 $html = ''; 97 129 } 130 /** 131 * Filter the post thumbnail HTML. 132 * 133 * @since 2.9.0 134 * 135 * @param string $html The post thumbnail HTML. 136 * @param string $post_id The post ID. 137 * @param string $post_thumbnail_id The post thumbnail ID. 138 * @param string $size The post thumbnail size. 139 * @param string $attr Query string of attributes. 140 */ 98 141 return apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr ); 99 142 }
Note: See TracChangeset
for help on using the changeset viewer.