Ticket #11310: 11310.patch
| File 11310.patch, 1.5 KB (added by , 17 years ago) |
|---|
-
post-image-template.php
9 9 * @subpackage Template 10 10 */ 11 11 12 /** 13 * Check if post has an image attached. 14 * 15 * @since 2.9.0 16 * 17 * @param int $post_id Optional. Post ID. 18 * @return bool Whether post has an image attached (true) or not (false). 19 */ 12 20 function has_post_image( $post_id = NULL ) { 13 21 global $id; 14 22 $post_id = ( NULL === $post_id ) ? $id : $post_id; 15 23 return !! get_post_image_id( $post_id ); 16 24 } 17 25 26 /** 27 * Retrieve Post Image ID. 28 * 29 * @since 2.9.0 30 * 31 * @param int $post_id Optional. Post ID. 32 * @return int 33 */ 18 34 function get_post_image_id( $post_id = NULL ) { 19 35 global $id; 20 36 $post_id = ( NULL === $post_id ) ? $id : $post_id; 21 37 return get_post_meta( $post_id, '_thumbnail_id', true ); 22 38 } 23 39 40 /** 41 * Display Post Image. 42 * 43 * @since 2.9.0 44 * 45 * @param int $size Optional. Image size. Defaults to 'thumbnail'. 46 * @param int $attr Optional. 47 */ 24 48 function the_post_image( $size = 'thumbnail', $attr = '' ) { 25 49 echo get_the_post_image( NULL, $size, $attr ); 26 50 } 27 51 52 /** 53 * Retrieve Post Image. 54 * 55 * @since 2.9.0 56 * 57 * @param int $post_id Optional. Post ID. 58 * @param string $size Optional. Image size. Defaults to 'thumbnail'. 59 * @param int $attr Optional. 60 */ 28 61 function get_the_post_image( $post_id = NULL, $size = 'thumbnail', $attr = '' ) { 29 62 global $id; 30 63 $post_id = ( NULL === $post_id ) ? $id : $post_id;
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)