Make WordPress Core


Ignore:
Timestamp:
07/15/2007 05:52:50 PM (17 years ago)
Author:
ryan
Message:

Show upload file size in upload browser. Props tellyworth. fixes #4561

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/upload.php

    r5676 r5801  
    66    $attachment_data = wp_get_attachment_metadata( $id );
    77    $is_image = (int) wp_attachment_is_image();
     8    $filesystem_path = get_attached_file( $id );
    89    if ( !isset($attachment_data['width']) && $is_image ) {
    9         if ( $image_data = getimagesize( get_attached_file( $id ) ) ) {
     10        if ( $image_data = getimagesize( $filesystem_path ) ) {
    1011            $attachment_data['width'] = $image_data[0];
    1112            $attachment_data['height'] = $image_data[1];
     
    3940    if ( $href )
    4041        $r .= "</a>\n";
     42    $r .= "\t\t\t\t<span class='upload-file-size'>".size_format(filesize($filesystem_path))."</span>\n";
    4143    $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n";
    4244    $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n";
Note: See TracChangeset for help on using the changeset viewer.