Make WordPress Core

Changeset 14682


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

show upload limit in media upload UI, see #12853

Location:
trunk
Files:
2 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,
  • trunk/wp-includes/script-loader.php

    r14673 r14682  
    204204    $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', array(
    205205            'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
    206             'file_exceeds_size_limit' => sprintf( __('This file is too big. The maximum upload size for your server is %s.'), $max_upload_size ),
     206            'file_exceeds_size_limit' => __('This file exceeds the maximum upload size for this site.'),
    207207            'zero_byte_file' => __('This file is empty. Please try another.'),
    208208            'invalid_filetype' => __('This file type is not allowed. Please try another.'),
Note: See TracChangeset for help on using the changeset viewer.