Make WordPress Core


Ignore:
Timestamp:
04/07/2017 02:35:39 PM (7 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/load.php

    r40347 r40394  
    10731073    return ( $thing instanceof WP_Error );
    10741074}
     1075
     1076/**
     1077 * Determines whether file modifications are disallowed.
     1078 *
     1079 * @since 4.8.0
     1080 *
     1081 * @param string $context The usage context.
     1082 * @return bool True if file modification is disallowed, false otherwise.
     1083 */
     1084function wp_disallow_file_mods( $context ) {
     1085    /**
     1086     * Filters whether file modifications are disallowed.
     1087     *
     1088     * @since 4.8.0
     1089     *
     1090     * @param bool   $disllow_file_mods Whether file modifications are disallowed.
     1091     * @param string $context           The usage context.
     1092     */
     1093    return apply_filters( 'disallow_file_mods' , defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS, $context );
     1094}
Note: See TracChangeset for help on using the changeset viewer.