Changeset 12134 for trunk/wp-includes/post-template.php
- Timestamp:
- 11/01/2009 10:10:06 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r12105 r12134 882 882 883 883 // 884 // Post images885 //886 887 function has_post_image( $post_id = NULL ) {888 global $id;889 $post_id = ( NULL === $post_id ) ? $id : $post_id;890 return !! get_post_image_id( $post_id );891 }892 893 function get_post_image_id( $post_id = NULL ) {894 global $id;895 $post_id = ( NULL === $post_id ) ? $id : $post_id;896 return get_post_meta( $post_id, '_thumbnail_id', true );897 }898 899 function the_post_image( $size = 'thumbnail', $attr = '' ) {900 echo get_the_post_image( NULL, $size, $attr );901 }902 903 function get_the_post_image( $post_id = NULL, $size = 'thumbnail', $attr = '' ) {904 global $id;905 $post_id = ( NULL === $post_id ) ? $id : $post_id;906 $post_image_id = get_post_image_id( $post_id );907 $size = apply_filters( 'post_image_size', $size );908 if ( $post_image_id ) {909 do_action( 'begin_fetch_post_image_html', $post_id, $post_image_id, $size ); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters910 $html = wp_get_attachment_image( $post_image_id, $size, false, $attr );911 do_action( 'end_fetch_post_image_html', $post_id, $post_image_id, $size );912 } else {913 $html = '';914 }915 return apply_filters( 'post_image_html', $html, $post_id, $post_image_id );916 }917 918 //919 884 // Attachments 920 885 //
Note: See TracChangeset
for help on using the changeset viewer.