Ticket #20409: 20409.diff
| File 20409.diff, 1.7 KB (added by , 14 years ago) |
|---|
-
wp-includes/post-thumbnail-template.php
10 10 */ 11 11 12 12 /** 13 * Check if post has an image attached.14 *15 * @since 2.9.016 *17 * @param int $post_id Optional. Post ID.18 * @return bool Whether post has an image attached.19 */20 function has_post_thumbnail( $post_id = null ) {21 return (bool) get_post_thumbnail_id( $post_id );22 }23 24 /**25 * Retrieve Post Thumbnail ID.26 *27 * @since 2.9.028 *29 * @param int $post_id Optional. Post ID.30 * @return int31 */32 function get_post_thumbnail_id( $post_id = null ) {33 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;34 return get_post_meta( $post_id, '_thumbnail_id', true );35 }36 37 /**38 13 * Display Post Thumbnail. 39 14 * 40 15 * @since 2.9.0 -
wp-admin/includes/post.php
1131 1131 } 1132 1132 1133 1133 /** 1134 * Check if post has an image attached. 1135 * 1136 * @since 2.9.0 1137 * 1138 * @param int $post_id Optional. Post ID. 1139 * @return bool Whether post has an image attached. 1140 */ 1141 function has_post_thumbnail( $post_id = null ) { 1142 return (bool) get_post_thumbnail_id( $post_id ); 1143 } 1144 1145 /** 1146 * Retrieve Post Thumbnail ID. 1147 * 1148 * @since 2.9.0 1149 * 1150 * @param int $post_id Optional. Post ID. 1151 * @return int 1152 */ 1153 function get_post_thumbnail_id( $post_id = null ) { 1154 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; 1155 return get_post_meta( $post_id, '_thumbnail_id', true ); 1156 } 1157 1158 /** 1134 1159 * Output HTML for the post thumbnail meta-box. 1135 1160 * 1136 1161 * @since 2.9.0