WordPress.org

Make WordPress Core

Ticket #23392: 23392.patch

File 23392.patch, 910 bytes (added by anatolbroder, 5 years ago)
  • wp-includes/media.php

     
    138138        if ( !wp_attachment_is_image($id) )
    139139                return false;
    140140
     141        // plugins can use this to provide resize services
     142        if ( $out = apply_filters( 'image_downsize', false, $id, $size ) )
     143                return $out;
     144
    141145        $img_url = wp_get_attachment_url($id);
    142146        $meta = wp_get_attachment_metadata($id);
    143147        $width = $height = 0;
    144148        $is_intermediate = false;
    145149        $img_url_basename = wp_basename($img_url);
    146150
    147         // plugins can use this to provide resize services
    148         if ( $out = apply_filters('image_downsize', false, $id, $size) )
    149                 return $out;
    150 
    151151        // try for a new style intermediate size
    152152        if ( $intermediate = image_get_intermediate_size($id, $size) ) {
    153153                $img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);