Changeset 12134
- Timestamp:
- 11/01/2009 10:10:06 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
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 // -
trunk/wp-includes/theme.php
r12132 r12134 1306 1306 /** 1307 1307 * Allows a theme to register its support of a certain feature 1308 * 1309 * Must be called in the themes functions.php file to work. 1308 1310 * 1309 1311 * @author Mark Jaquith … … 1330 1332 } 1331 1333 1334 /** 1335 * Checks a theme's support for a given feature before loading the functions which implement it. 1336 * 1337 * @author Peter Westwood 1338 * @since 2.9 1339 * @param string $feature the feature being checked 1340 * @param string $include the file containing the functions that implement the feature 1341 */ 1342 function require_if_theme_supports( $feature, $include) { 1343 if ( current_theme_supports( $feature ) ) 1344 require ( $include ); 1345 } 1346 1332 1347 ?> -
trunk/wp-settings.php
r12128 r12134 688 688 include(TEMPLATEPATH . '/functions.php'); 689 689 690 // Load in support for template functions which the theme supports 691 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-image-template.php' ); 692 690 693 /** 691 694 * Runs just before PHP shuts down execution.
Note: See TracChangeset
for help on using the changeset viewer.