From 818598ac2c34ba39ff6346d22af975c3720360d3 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 23 Sep 2012 17:48:24 +0000 Subject: [PATCH] Deprecate wp_create_thumbnail(). props obenland. fixes #21555. git-svn-id: https://develop.svn.wordpress.org/trunk@21956 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/deprecated.php | 19 ++++++++++++++++++- wp-admin/includes/image.php | 21 --------------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/wp-admin/includes/deprecated.php b/wp-admin/includes/deprecated.php index a40caa2ba1..5d88b3a1ec 100644 --- a/wp-admin/includes/deprecated.php +++ b/wp-admin/includes/deprecated.php @@ -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 ) ); +} diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 5af65465d9..c7638cdbae 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -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. *