WordPress.org

Make WordPress Core

Ticket #34936: 34936.5.diff

File 34936.5.diff, 3.7 KB (added by DrewAPicture, 3 years ago)
  • src/wp-includes/load.php

     
    183183        // If the $upgrading timestamp is older than 10 minutes, don't die.
    184184        if ( ( time() - $upgrading ) >= 600 )
    185185                return;
    186        
     186
    187187        /**
    188          * Bypass the maintenance mode check
     188         * Filters whether to enable loading of the maintenance.php drop-in.
    189189         *
    190          * This filter should *NOT* be used by plugins. It is designed for non-web
    191          * runtimes. If this filter returns true, maintenance mode will not be 
    192          * active which can cause problems during updates for web site views.
     190         * This filter runs before it can be used by plugins. It is designed for
     191         * non-web runtimes. If this filter returns true, maintenance mode will be
     192         * active and the request will end. If false, the request will be allowed to
     193         * continue processing even if maintenance mode should be active.
    193194         *
    194195         * @since 4.6.0
    195196         *
    196          * @param bool True to bypass maintenance
     197         * @param bool $enable_checks Whether to enable loading maintenance.php (if present). Default true.
     198         * @param int  $upgrading     The timestamp set in the .maintenance file.
    197199         */
    198         if ( apply_filters( 'bypass_maintenance_mode', false ) ){
    199                 return; 
     200        if ( ! apply_filters( 'enable_loading_maintenance_dropin', true, $upgrading ) ) {
     201                return;
    200202        }
    201203
    202204        if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
     
    301303 */
    302304function wp_debug_mode() {
    303305        /**
    304          * Bypass the debug mode check
     306         * Filters whether to allow the debug mode check to occur.
    305307         *
    306          * This filter should *NOT* be used by plugins. It is designed for non-web
    307          * runtimes. Returning true causes the WP_DEBUG and related constants to
    308          * not be checked and the default php values for errors will be used unless
    309          * you take care to update them yourself.
     308         * This filter runs before it can be used by plugins. It is designed for
     309         * non-web run-times. Returning false causes the `WP_DEBUG` and related
     310         * constants to not be checked and the default php values for errors
     311         * will be used unless you take care to update them yourself.
    310312         *
    311313         * @since 4.6.0
    312314         *
    313          * @param bool True to bypass debug mode
     315         * @param bool $enable_debug_mode Whether to enable debug mode checks to occur. Default true.
    314316         */
    315         if ( apply_filters( 'bypass_debug_mode', false ) ){
    316                 return; 
     317        if ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ){
     318                return;
    317319        }
    318320
    319321        if ( WP_DEBUG ) {
  • src/wp-settings.php

     
    7171wp_debug_mode();
    7272
    7373/**
    74  * Bypass the loading of advanced-cache.php
     74 * Filters whether to enable loading of the advanced-cache.php drop-in.
    7575 *
    76  * This filter should *NOT* be used by plugins. It is designed for non-web
    77  * runtimes. If true is returned, advance-cache.php will never be loaded.
     76 * This filter runs before it can be used by plugins. It is designed for non-web
     77 * run-times. If false is returned, advance-cache.php will never be loaded.
    7878 *
    7979 * @since 4.6.0
    8080 *
    81  * @param bool True to bypass advanced-cache.php
     81 * @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present).
     82 *                                    Default true.
    8283 */
    83 if ( WP_CACHE && ! apply_filters( 'bypass_advanced_cache', false ) ) {
     84if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) ) {
    8485// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
    8586        _backup_plugin_globals();
    8687        WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' );