From 3d3a2a7692bbebd9223e688fd1008dedcd5dc97d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 14 Feb 2013 04:30:55 +0000 Subject: [PATCH] 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 --- wp-includes/media.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 682ffbb77c..2b770ceff3 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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);