WordPress.org

Make WordPress Core

Ticket #21555: 21555.diff

File 21555.diff, 2.2 KB (added by obenland, 21 months ago)
  • wp-admin/includes/image.php

     
    77 */ 
    88 
    99/** 
    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 } 
    29  
    30 /** 
    3110 * Crop an Image to a given size. 
    3211 * 
    3312 * @since 2.1.0 
  • wp-admin/includes/deprecated.php

     
    958958function _media_button($title, $icon, $type, $id) { 
    959959        _deprecated_function( __FUNCTION__, '3.5' ); 
    960960} 
     961 
     962/** 
     963 * This was once used to create a thumbnail from an Image given a maximum side size. 
     964 * 
     965 * This function can handle most image file formats which PHP supports. If PHP 
     966 * does not have the functionality to save in a file of the same format, the 
     967 * thumbnail will be created as a jpeg. 
     968 * 
     969 * @since 1.2.0 
     970 * @deprecated 3.5.0 
     971 * 
     972 * @param mixed $file Filename of the original image, Or attachment id. 
     973 * @param int $max_side Maximum length of a single side for the thumbnail. 
     974 * @param mixed $deprecated Never used. 
     975 * @return string Thumbnail path on success, Error string on failure. 
     976 */ 
     977function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { 
     978        _deprecated_function( __FUNCTION__, '3.5', 'image_resize' ); 
     979        return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) ); 
     980}