Add file size to attachment publish meta box. props desrosj. fixes #25170.
Built from https://develop.svn.wordpress.org/trunk@25403 git-svn-id: http://core.svn.wordpress.org/trunk@25333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4542e678d2
commit
0758df9758
|
@ -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 ) ):
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue