mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-10 07:34:34 +00:00
Upgrade/Install: Introduce wp_disallow_file_mods() helper function.
This is a wrapper around the checks for the `DISALLOW_FILE_MODS` constant to determine whether file modifications are disallowed. Props MaximeCulea. Fixes #38673. git-svn-id: https://develop.svn.wordpress.org/trunk@40394 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1072,3 +1072,23 @@ function wp_doing_ajax() {
|
||||
function is_wp_error( $thing ) {
|
||||
return ( $thing instanceof WP_Error );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether file modifications are disallowed.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @param string $context The usage context.
|
||||
* @return bool True if file modification is disallowed, false otherwise.
|
||||
*/
|
||||
function wp_disallow_file_mods( $context ) {
|
||||
/**
|
||||
* Filters whether file modifications are disallowed.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @param bool $disllow_file_mods Whether file modifications are disallowed.
|
||||
* @param string $context The usage context.
|
||||
*/
|
||||
return apply_filters( 'disallow_file_mods' , defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS, $context );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user