WordPress.org

Make WordPress Core

Changeset 40638


Ignore:
Timestamp:
05/11/2017 07:23:45 PM (2 years ago)
Author:
swissspidy
Message:

Upgrade/Install: After [40394], rename wp_disallow_file_mods() to wp_is_file_mod_allowed().

This makes it more clear what this function is about.

Props Mte90.
Fixes #38673.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-automatic-updater.php

    r40394 r40638  
    3232    public function is_disabled() {
    3333        // Background updates are disabled if you don't want file changes.
    34         if ( wp_disallow_file_mods( 'automatic_updater' ) )
     34        if ( ! wp_is_file_mod_allowed( 'automatic_updater' ) )
    3535            return true;
    3636
  • trunk/src/wp-admin/includes/translation-install.php

    r40394 r40638  
    203203    }
    204204
    205     if ( wp_disallow_file_mods( 'download_language_pack' ) ) {
     205    if ( ! wp_is_file_mod_allowed( 'download_language_pack' ) ) {
    206206        return false;
    207207    }
     
    246246 */
    247247function wp_can_install_language_pack() {
    248     if ( wp_disallow_file_mods( 'can_install_language_pack' ) ) {
     248    if ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) {
    249249        return false;
    250250    }
  • trunk/src/wp-includes/capabilities.php

    r40404 r40638  
    363363        if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
    364364            $caps[] = 'do_not_allow';
    365         elseif ( wp_disallow_file_mods( 'capability_edit_themes' ) )
     365        elseif ( ! wp_is_file_mod_allowed( '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 ( wp_disallow_file_mods( 'capability_update_core' ) ) {
     383        if ( ! wp_is_file_mod_allowed( 'capability_update_core' ) ) {
    384384            $caps[] = 'do_not_allow';
    385385        } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
  • trunk/src/wp-includes/load.php

    r40575 r40638  
    11001100 * @return bool True if file modification is disallowed, false otherwise.
    11011101 */
    1102 function wp_disallow_file_mods( $context ) {
     1102function wp_is_file_mod_allowed( $context ) {
    11031103    /**
    11041104     * Filters whether file modifications are disallowed.
     
    11061106     * @since 4.8.0
    11071107     *
    1108      * @param bool   $disllow_file_mods Whether file modifications are disallowed.
    1109      * @param string $context           The usage context.
     1108     * @param bool   $disallow_file_mods Whether file modifications are disallowed.
     1109     * @param string $context            The usage context.
    11101110     */
    1111     return apply_filters( 'disallow_file_mods' , defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS, $context );
    1112 }
     1111    return apply_filters( 'disallow_file_mods', defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS, $context );
     1112}
Note: See TracChangeset for help on using the changeset viewer.