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

git-svn-id: https://develop.svn.wordpress.org/trunk@25403 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2013-09-12 15:09:35 +00:00
parent 654d07ebf9
commit 435c2b5686

View File

@ -2450,7 +2450,19 @@ function attachment_submitbox_metadata() {
?></strong>
</div>
<?php
<?php
if ( isset( $meta['filesize'] ) )
$file_size = $meta['filesize'];
else
$file_size = filesize( get_attached_file( $post->ID ) );
if ( ! empty( $file_size ) ) : ?>
<div class="misc-pub-section misc-pub-filesize">
<?php _e( 'File size:' ); ?> <strong><?php echo size_format( $file_size ); ?></strong>
</div>
<?php
endif;
if ( preg_match( '#^audio|video#', $post->post_mime_type ) ):
/**