Make WordPress Core

Opened 8 years ago

Last modified 7 years ago

#36423 new feature request

Constant in wp-config.php to disable uploads

Reported by: stevegrunwell's profile stevegrunwell Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Upload Keywords:
Focuses: Cc:

Description

During a conversation with @ jasondewitt10up today, he asked if there was a wp-config.php constant he could define to disable uploads within WordPress (his specific use-case was in case the containerized filesystem went away, but I could also see uses during migration/content freezes, while performing some upgrades, etc.

I'd be interested to hear the core team's thoughts on a constant like DISABLE_FILE_UPLOAD, which would function in a similar fashion to DISALLOW_FILE_EDIT and DISALLOW_FILE_MODS. Is there a stance for or against more wp-config.php constants, or is it a "only if they really make sense and would be applicable for a large % of the install base" decision?

Change History (2)

#1 @aaronholbrook
8 years ago

I think this would be a good thing to be able to cleanly define with a single constant. +1

#2 @swissspidy
7 years ago

I personally think we should avoid adding too many constants because of backward compatibility problems and how they're not testable.

#38673 aims to introduce a wp_disallow_file_mods( $context ) function. Perhaps this could be used to conditionally disable file uploads?

Note: See TracTickets for help on using tickets.