From 997c0f80878ac6027ca61c8f4dbd09f5df9c3129 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 21 May 2010 12:57:49 +0000 Subject: [PATCH] We're not as bold as some people make us out to be. Move the maximum upload size from a Heading to a paragraph text. Fix screen formatting on Multisite when over quota. see #12853 git-svn-id: https://develop.svn.wordpress.org/trunk@14776 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/media.php | 38 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 96cabb329b..9571fb5b04 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1400,6 +1400,16 @@ function media_upload_form( $errors = null ) { $flash = apply_filters('flash_uploader', $flash); $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0; + $upload_size_unit = $max_upload_size = wp_max_upload_size(); + $sizes = array( 'KB', 'MB', 'GB' ); + for ( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ ) + $upload_size_unit /= 1024; + if ( $u < 0 ) { + $upload_size_unit = 0; + $u = 0; + } else { + $upload_size_unit = (int) $upload_size_unit; + } ?>