Changeset 15990 for trunk/wp-includes/post-thumbnail-template.php
- Timestamp:
- 10/27/2010 12:33:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-thumbnail-template.php
r15549 r15990 18 18 * @return bool Whether post has an image attached. 19 19 */ 20 function has_post_thumbnail( $post_id = NULL) {21 $post_id = ( NULL=== $post_id ) ? get_the_ID() : $post_id;22 return !!get_post_thumbnail_id( $post_id );20 function has_post_thumbnail( $post_id = null ) { 21 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; 22 return (bool) get_post_thumbnail_id( $post_id ); 23 23 } 24 24 … … 31 31 * @return int 32 32 */ 33 function get_post_thumbnail_id( $post_id = NULL) {34 $post_id = ( NULL=== $post_id ) ? get_the_ID() : $post_id;33 function get_post_thumbnail_id( $post_id = null ) { 34 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; 35 35 return get_post_meta( $post_id, '_thumbnail_id', true ); 36 36 } … … 45 45 */ 46 46 function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) { 47 echo get_the_post_thumbnail( NULL, $size, $attr );47 echo get_the_post_thumbnail( null, $size, $attr ); 48 48 } 49 49 … … 57 57 * @param string|array $attr Optional. Query string or array of attributes. 58 58 */ 59 function get_the_post_thumbnail( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) {60 $post_id = ( NULL=== $post_id ) ? get_the_ID() : $post_id;59 function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) { 60 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; 61 61 $post_thumbnail_id = get_post_thumbnail_id( $post_id ); 62 62 $size = apply_filters( 'post_thumbnail_size', $size );
Note: See TracChangeset
for help on using the changeset viewer.