Make WordPress Core

Ticket #20534: 20534.3.diff

File 20534.3.diff, 913 bytes (added by justindgivens, 13 years ago)

Updated with the new function.

  • wp-includes/media.php

     
    613613function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) {
    614614
    615615        // get a thumbnail or intermediate image if there is one
    616         if ( $image = image_downsize($attachment_id, $size) )
     616        if ( $image = image_downsize( $attachment_id, $size ) ) {
     617                if( is_admin() )
     618                        $image = set_url_scheme( $image, 'admin' );
     619                else
     620                        $image = set_url_scheme( $image );
    617621                return $image;
     622        }
    618623
    619624        $src = false;
    620625
     
    624629                @list($width, $height) = getimagesize($src_file);
    625630        }
    626631        if ( $src && $width && $height )
     632                if( is_admin() )
     633                        $src = set_url_scheme( $src, 'admin' );
     634                else
     635                        $src = set_url_scheme( $src );
    627636                return array( $src, $width, $height );
    628637        return false;
    629638}