- File:
-
- 1 edited
-
trunk/wp-includes/post-thumbnail-template.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-thumbnail-template.php
r15990 r13382 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 (bool) get_post_thumbnail_id( $post_id ); 20 function has_post_thumbnail( $post_id = NULL ) { 21 global $id; 22 $post_id = ( NULL === $post_id ) ? $id : $post_id; 23 return !! get_post_thumbnail_id( $post_id ); 23 24 } 24 25 … … 31 32 * @return int 32 33 */ 33 function get_post_thumbnail_id( $post_id = null ) { 34 $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; 34 function get_post_thumbnail_id( $post_id = NULL ) { 35 global $id; 36 $post_id = ( NULL === $post_id ) ? $id : $post_id; 35 37 return get_post_meta( $post_id, '_thumbnail_id', true ); 36 38 } … … 45 47 */ 46 48 function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) { 47 echo get_the_post_thumbnail( null, $size, $attr );49 echo get_the_post_thumbnail( NULL, $size, $attr ); 48 50 } 49 51 … … 56 58 * @param string $size Optional. Image size. Defaults to 'thumbnail'. 57 59 * @param string|array $attr Optional. Query string or array of attributes. 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; 60 */ 61 function get_the_post_thumbnail( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) { 62 global $id; 63 $post_id = ( NULL === $post_id ) ? $id : $post_id; 61 64 $post_thumbnail_id = get_post_thumbnail_id( $post_id ); 62 65 $size = apply_filters( 'post_thumbnail_size', $size );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)