summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/includes/upload.php')
-rw-r--r--wp-admin/includes/upload.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/wp-admin/includes/upload.php b/wp-admin/includes/upload.php
index 9d3fda1..61b0302 100644
--- a/wp-admin/includes/upload.php
+++ b/wp-admin/includes/upload.php
@@ -102,6 +102,13 @@ function wp_upload_view() {
}
function wp_upload_form() {
+ if ( defined('DISABLE_UPLOADS') && constant('DISABLE_UPLOADS') ) {
+ if ( defined('DISABLE_UPLOADS_MESSAGE') && constant('DISABLE_UPLOADS_MESSAGE') ) {
+ return print(__(DISABLE_UPLOADS_MESSAGE));
+ } else {
+ return print(__('Sorry, uploads are temporarily disabled.'));
+ }
+ }
$id = get_the_ID();
global $post_id, $tab, $style;
$enctype = $id ? '' : ' enctype="multipart/form-data"';
@@ -194,6 +201,13 @@ function wp_upload_tab_upload_action() {
switch ( $action ) :
case 'upload' :
+ if ( defined('DISABLE_UPLOADS') && constant('DISABLE_UPLOADS') ) {
+ if ( defined('DISABLE_UPLOADS_MESSAGE') && constant('DISABLE_UPLOADS_MESSAGE') ) {
+ return die(__(DISABLE_UPLOADS_MESSAGE));
+ } else {
+ return die(__('Sorry, uploads are temporarily disabled.'));
+ }
+ }
global $from_tab, $post_id, $style;
if ( !$from_tab )
$from_tab = 'upload';