Make WordPress Core


Ignore:
Timestamp:
05/15/2010 11:57:32 PM (14 years ago)
Author:
wpmuguru
Message:

show upload limit in media upload UI, see #12853

File:
1 edited

Legend:

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

    r14656 r14682  
    14201420<?php } ?>
    14211421</div>
     1422<div id="media-upload-size">
     1423<?php
     1424    $upload_size_unit = $max_upload_size =  wp_max_upload_size();
     1425    $sizes = array( 'KB', 'MB', 'GB' );
     1426    for( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ )
     1427        $upload_size_unit /= 1024;
     1428    if ( $u < 0 ) {
     1429        $upload_size_unit = 0;
     1430        $u = 0;
     1431    } else {
     1432        $upload_size_unit = (int) $upload_size_unit;
     1433    }
     1434    printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] );
     1435?>
     1436</div>
    14221437
    14231438<?php
     
    14541469                "short" : "1"
    14551470            },
    1456             file_size_limit : "<?php echo wp_max_upload_size(); ?>b",
     1471            file_size_limit : "<?php echo $max_upload_size; ?>b",
    14571472            file_dialog_start_handler : fileDialogStart,
    14581473            file_queued_handler : fileQueued,
Note: See TracChangeset for help on using the changeset viewer.