Return from image_downsize() earlier if a custom resize function is used. props anatolbroder. fixes #23392.

git-svn-id: https://develop.svn.wordpress.org/trunk@23410 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-02-14 04:30:55 +00:00
parent d8acf69968
commit 04778f60ac
1 changed files with 4 additions and 4 deletions

View File

@ -138,16 +138,16 @@ function image_downsize($id, $size = 'medium') {
if ( !wp_attachment_is_image($id) )
return false;
// plugins can use this to provide resize services
if ( $out = apply_filters( 'image_downsize', false, $id, $size ) )
return $out;
$img_url = wp_get_attachment_url($id);
$meta = wp_get_attachment_metadata($id);
$width = $height = 0;
$is_intermediate = false;
$img_url_basename = wp_basename($img_url);
// plugins can use this to provide resize services
if ( $out = apply_filters('image_downsize', false, $id, $size) )
return $out;
// try for a new style intermediate size
if ( $intermediate = image_get_intermediate_size($id, $size) ) {
$img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);