WordPress.org

Make WordPress Core

Ticket #8268: image_downsize.diff

File image_downsize.diff, 862 bytes (added by jbrinley, 10 years ago)

Patch for image_downsize in wp-includes/media.php

  • wp-includes/media.php

     
    125125 */
    126126function image_downsize($id, $size = 'medium') {
    127127
     128        // plugins can use this to provide resize services
     129        if ( $out = apply_filters('image_downsize', false, $id, $size) )
     130                return $out;
     131
    128132        if ( !wp_attachment_is_image($id) )
    129133                return false;
    130134
     
    133137        $width = $height = 0;
    134138        $is_intermediate = false;
    135139
    136         // plugins can use this to provide resize services
    137         if ( $out = apply_filters('image_downsize', false, $id, $size) )
    138                 return $out;
    139 
    140140        // try for a new style intermediate size
    141141        if ( $intermediate = image_get_intermediate_size($id, $size) ) {
    142142                $img_url = str_replace(basename($img_url), $intermediate['file'], $img_url);