WordPress.org

Make WordPress Core

Changeset 21956


Ignore:
Timestamp:
09/23/12 17:48:24 (19 months ago)
Author:
nacin
Message:

Deprecate wp_create_thumbnail(). props obenland. fixes #21555.

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/deprecated.php

    r21835 r21956  
    998998 * @since 2.5.0 
    999999 * @deprecated 3.5.0 
    1000  * @deprecated Use get_default_post_to_edit()  
     1000 * @deprecated Use get_default_post_to_edit() 
    10011001 * 
    10021002 * @return WP_Post Post object containing all the default post data as attributes 
     
    10101010} 
    10111011 
     1012/** 
     1013 * This was once used to create a thumbnail from an Image given a maximum side size. 
     1014 * 
     1015 * @since 1.2.0 
     1016 * @deprecated 3.5.0 
     1017 * @deprecated Use image_resize() 
     1018 * @see  image_resize() 
     1019 * 
     1020 * @param mixed $file Filename of the original image, Or attachment id. 
     1021 * @param int $max_side Maximum length of a single side for the thumbnail. 
     1022 * @param mixed $deprecated Never used. 
     1023 * @return string Thumbnail path on success, Error string on failure. 
     1024 */ 
     1025function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { 
     1026    _deprecated_function( __FUNCTION__, '3.5', 'image_resize' ); 
     1027    return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) ); 
     1028} 
  • trunk/wp-admin/includes/image.php

    r21905 r21956  
    66 * @subpackage Administration 
    77 */ 
    8  
    9 /** 
    10  * Create a thumbnail from an Image given a maximum side size. 
    11  * 
    12  * This function can handle most image file formats which PHP supports. If PHP 
    13  * does not have the functionality to save in a file of the same format, the 
    14  * thumbnail will be created as a jpeg. 
    15  * 
    16  * @since 1.2.0 
    17  * 
    18  * @param mixed $file Filename of the original image, Or attachment id. 
    19  * @param int $max_side Maximum length of a single side for the thumbnail. 
    20  * @param mixed $deprecated Never used. 
    21  * @return string Thumbnail path on success, Error string on failure. 
    22  */ 
    23 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { 
    24     if ( !empty( $deprecated ) ) 
    25         _deprecated_argument( __FUNCTION__, '1.2' ); 
    26     $thumbpath = image_resize( $file, $max_side, $max_side ); 
    27     return apply_filters( 'wp_create_thumbnail', $thumbpath ); 
    28 } 
    298 
    309/** 
Note: See TracChangeset for help on using the changeset viewer.