Make WordPress Core

Ticket #20534: 20534.4.diff

File 20534.4.diff, 1006 bytes (added by justindgivens, 12 years ago)

Updated from last comments.

  • wp-includes/media.php

     
    508508function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) {
    509509
    510510        // get a thumbnail or intermediate image if there is one
    511         if ( $image = image_downsize($attachment_id, $size) )
     511        if ( $image = image_downsize( $attachment_id , $size ) ) {
     512                if( is_admin() )
     513                        $image = set_url_scheme( $image , 'admin' );
     514                else
     515                        $image = set_url_scheme( $image );
    512516                return $image;
     517        }
    513518
    514519        $src = false;
    515520
     
    518523                $src_file = $icon_dir . '/' . wp_basename($src);
    519524                @list($width, $height) = getimagesize($src_file);
    520525        }
    521         if ( $src && $width && $height )
     526        if ( $src && $width && $height ) {
     527                if( is_admin() )
     528                        $src = set_url_scheme( $src , 'admin' );
     529                else
     530                        $src = set_url_scheme( $src );
    522531                return array( $src, $width, $height );
     532        }
    523533        return false;
    524534}
    525535