You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -51,7 +56,8 @@ function image_hwstring($width, $height) {
51
56
52
57
// Scale an image to fit a particular size (such as 'thumb' or 'medium'), and return an image URL, height and width.
53
58
// The URL might be the original image, or it might be a resized version. This function won't create a new resized copy, it will just return an already resized one if it exists.
54
-
// returns an array($url, $width, $height)
59
+
// returns an array($url, $width, $height, $is_intermediate)
60
+
// $is_intermediate is true if $url is a resized image, false if it is the original
55
61
functionimage_downsize($id, $size = 'medium') {
56
62
57
63
if ( !wp_attachment_is_image($id) )
@@ -60,6 +66,7 @@ function image_downsize($id, $size = 'medium') {
60
66
$img_url = wp_get_attachment_url($id);
61
67
$meta = wp_get_attachment_metadata($id);
62
68
$width = $height = 0;
69
+
$is_intermediate = false;
63
70
64
71
// plugins can use this to provide resize services
65
72
if ( $out = apply_filters('image_downsize', false, $id, $size) )
@@ -70,22 +77,29 @@ function image_downsize($id, $size = 'medium') {
0 commit comments