Multisite: Make it easy to replace or augment the over-quota message displayed when you try and upload new media and you have reached your quota.

Fixes #21179 props dllh, jkudish. 


git-svn-id: http://core.svn.wordpress.org/trunk@21256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2012-07-10 13:33:44 +00:00
parent 4a5816348c
commit 2039e3a8f0
2 changed files with 6 additions and 2 deletions

View File

@ -1326,9 +1326,8 @@ function media_upload_form( $errors = null ) {
?></div> ?></div>
<?php <?php
// Check quota for this blog if multisite
if ( is_multisite() && !is_upload_space_available() ) { if ( is_multisite() && !is_upload_space_available() ) {
echo '<p>' . sprintf( __( 'Sorry, you have filled your storage quota (%s MB).' ), get_space_allowed() ) . '</p>'; do_action( 'upload_ui_over_quota' );
return; return;
} }
@ -2065,6 +2064,10 @@ function media_upload_flash_bypass() {
} }
add_action('post-plupload-upload-ui', 'media_upload_flash_bypass'); add_action('post-plupload-upload-ui', 'media_upload_flash_bypass');
function multisite_over_quota_message() {
echo '<p>' . sprintf( __( 'Sorry, you have used all of your storage quota of %s MB.' ), get_space_allowed() ) . '</p>';
}
/** /**
* {@internal Missing Short Description}} * {@internal Missing Short Description}}
* *

View File

@ -45,6 +45,7 @@ add_filter( 'wp_upload_bits', 'upload_is_file_too_big' );
add_filter( 'import_upload_size_limit', 'fix_import_form_size' ); add_filter( 'import_upload_size_limit', 'fix_import_form_size' );
add_filter( 'upload_mimes', 'check_upload_mimes' ); add_filter( 'upload_mimes', 'check_upload_mimes' );
add_filter( 'upload_size_limit', 'upload_size_limit_filter' ); add_filter( 'upload_size_limit', 'upload_size_limit_filter' );
add_action( 'upload_ui_over_quota', 'multisite_over_quota_message' );
// Mail // Mail
add_action( 'phpmailer_init', 'fix_phpmailer_messageid' ); add_action( 'phpmailer_init', 'fix_phpmailer_messageid' );