WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/07/2017 02:35:39 PM (4 years ago)
Author:
swissspidy
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r40390 r40394  
    363363        if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
    364364            $caps[] = 'do_not_allow';
    365         elseif ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
     365        elseif ( wp_disallow_file_mods( 'capability_edit_themes' ) )
    366366            $caps[] = 'do_not_allow';
    367367        elseif ( is_multisite() && ! is_super_admin( $user_id ) )
     
    381381        // Disallow anything that creates, deletes, or updates core, plugin, or theme files.
    382382        // Files in uploads are excepted.
    383         if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
     383        if ( wp_disallow_file_mods( 'capability_update_core' ) ) {
    384384            $caps[] = 'do_not_allow';
    385385        } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
Note: See TracChangeset for help on using the changeset viewer.