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

git-svn-id: http://core.svn.wordpress.org/trunk@21956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-23 17:48:24 +00:00
parent 76bc5c7c21
commit 70ad7496a6
2 changed files with 18 additions and 22 deletions

View File

@ -997,7 +997,7 @@ function get_post_to_edit( $id ) {
*
* @since 2.5.0
* @deprecated 3.5.0
* @deprecated Use get_default_post_to_edit()
* @deprecated Use get_default_post_to_edit()
*
* @return WP_Post Post object containing all the default post data as attributes
*/
@ -1009,3 +1009,20 @@ function get_default_page_to_edit() {
return $page;
}
/**
* This was once used to create a thumbnail from an Image given a maximum side size.
*
* @since 1.2.0
* @deprecated 3.5.0
* @deprecated Use image_resize()
* @see image_resize()
*
* @param mixed $file Filename of the original image, Or attachment id.
* @param int $max_side Maximum length of a single side for the thumbnail.
* @param mixed $deprecated Never used.
* @return string Thumbnail path on success, Error string on failure.
*/
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
_deprecated_function( __FUNCTION__, '3.5', 'image_resize' );
return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
}

View File

@ -6,27 +6,6 @@
* @subpackage Administration
*/
/**
* Create a thumbnail from an Image given a maximum side size.
*
* This function can handle most image file formats which PHP supports. If PHP
* does not have the functionality to save in a file of the same format, the
* thumbnail will be created as a jpeg.
*
* @since 1.2.0
*
* @param mixed $file Filename of the original image, Or attachment id.
* @param int $max_side Maximum length of a single side for the thumbnail.
* @param mixed $deprecated Never used.
* @return string Thumbnail path on success, Error string on failure.
*/
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '1.2' );
$thumbpath = image_resize( $file, $max_side, $max_side );
return apply_filters( 'wp_create_thumbnail', $thumbpath );
}
/**
* Crop an Image to a given size.
*