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:
parent
767f34de86
commit
3d3a2a7692
|
@ -138,16 +138,16 @@ function image_downsize($id, $size = 'medium') {
|
||||||
if ( !wp_attachment_is_image($id) )
|
if ( !wp_attachment_is_image($id) )
|
||||||
return false;
|
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);
|
$img_url = wp_get_attachment_url($id);
|
||||||
$meta = wp_get_attachment_metadata($id);
|
$meta = wp_get_attachment_metadata($id);
|
||||||
$width = $height = 0;
|
$width = $height = 0;
|
||||||
$is_intermediate = false;
|
$is_intermediate = false;
|
||||||
$img_url_basename = wp_basename($img_url);
|
$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
|
// try for a new style intermediate size
|
||||||
if ( $intermediate = image_get_intermediate_size($id, $size) ) {
|
if ( $intermediate = image_get_intermediate_size($id, $size) ) {
|
||||||
$img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);
|
$img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);
|
||||||
|
|
Loading…
Reference in New Issue