WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/08/2009 09:08:19 PM (11 years ago)
Author:
markjaquith
Message:

Introducing set_post_image_size(w, h, crop) so themes can register their special size/crop for canonical post images. WP will create this size/crop upon upload, so your canonical post images fit your space exactly!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-image-template.php

    r12339 r12342  
    4343 * @since 2.9.0
    4444 *
    45  * @param int $size Optional. Image size.  Defaults to 'thumbnail'.
     45 * @param int $size Optional. Image size.  Defaults to 'post-image', which theme sets using set_post_image_size( $width, $height, $crop_flag );.
    4646 * @param string|array $attr Optional. Query string or array of attributes.
    4747 */
    48 function the_post_image( $size = 'thumbnail', $attr = '' ) {
     48function the_post_image( $size = 'post-image', $attr = '' ) {
    4949    echo get_the_post_image( NULL, $size, $attr );
    5050}
     
    5959 * @param string|array $attr Optional. Query string or array of attributes.
    6060  */
    61 function get_the_post_image( $post_id = NULL, $size = 'thumbnail', $attr = '' ) {
     61function get_the_post_image( $post_id = NULL, $size = 'post-image', $attr = '' ) {
    6262    global $id;
    6363    $post_id = ( NULL === $post_id ) ? $id : $post_id;
Note: See TracChangeset for help on using the changeset viewer.