From 2039e3a8f0b31aab0fe6b4e10f72afb442fe0d04 Mon Sep 17 00:00:00 2001
From: westi
Date: Tue, 10 Jul 2012 13:33:44 +0000
Subject: [PATCH] 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
---
wp-admin/includes/media.php | 7 +++++--
wp-includes/ms-default-filters.php | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index fba8bcc033..1fa645896f 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -1326,9 +1326,8 @@ function media_upload_form( $errors = null ) {
?>
' . sprintf( __( 'Sorry, you have filled your storage quota (%s MB).' ), get_space_allowed() ) . '
';
+ do_action( 'upload_ui_over_quota' );
return;
}
@@ -2065,6 +2064,10 @@ function media_upload_flash_bypass() {
}
add_action('post-plupload-upload-ui', 'media_upload_flash_bypass');
+function multisite_over_quota_message() {
+ echo '' . sprintf( __( 'Sorry, you have used all of your storage quota of %s MB.' ), get_space_allowed() ) . '
';
+}
+
/**
* {@internal Missing Short Description}}
*
diff --git a/wp-includes/ms-default-filters.php b/wp-includes/ms-default-filters.php
index 44d8294ac5..45410143d6 100644
--- a/wp-includes/ms-default-filters.php
+++ b/wp-includes/ms-default-filters.php
@@ -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( 'upload_mimes', 'check_upload_mimes' );
add_filter( 'upload_size_limit', 'upload_size_limit_filter' );
+add_action( 'upload_ui_over_quota', 'multisite_over_quota_message' );
// Mail
add_action( 'phpmailer_init', 'fix_phpmailer_messageid' );