Make WordPress Core

Changeset 25403


Ignore:
Timestamp:
09/12/2013 03:09:35 PM (11 years ago)
Author:
helen
Message:

Add file size to attachment publish meta box. props desrosj. fixes #25170.

File:
1 edited

Legend:

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

    r25300 r25403  
    24512451    </div>
    24522452
    2453 <?php
     2453    <?php
     2454        if ( isset( $meta['filesize'] ) )
     2455            $file_size = $meta['filesize'];
     2456        else
     2457            $file_size = filesize( get_attached_file( $post->ID ) );
     2458
     2459        if ( ! empty( $file_size ) ) : ?>
     2460            <div class="misc-pub-section misc-pub-filesize">
     2461                <?php _e( 'File size:' ); ?> <strong><?php echo size_format( $file_size ); ?></strong>
     2462            </div>
     2463            <?php
     2464        endif;
     2465
    24542466    if ( preg_match( '#^audio|video#', $post->post_mime_type ) ):
    24552467
Note: See TracChangeset for help on using the changeset viewer.