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

git-svn-id: http://core.svn.wordpress.org/trunk@23410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-02-14 04:30:55 +00:00
parent 767f34de86
commit 3d3a2a7692

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);