WordPress.org

Make WordPress Core

Ticket #34936: 34936.diff

File 34936.diff, 2.0 KB (added by jorbin, 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       
     187        /**
     188         * Bypass the maintenance mode check
     189         *
     190         * This filter should *NOT* be used by plugins. It is designed for non-web
     191         * runtimes.
     192         *
     193         * @since 4.6.0
     194         *
     195         * @ignore
     196         * @param bool True to bypass maintenance
     197         */
     198        if ( apply_filters( 'bypass_maintenance_mode', false ) ){
     199                return;
     200        }
    186201
    187202        if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
    188203                require_once( WP_CONTENT_DIR . '/maintenance.php' );
     
    285300 * @access private
    286301 */
    287302function wp_debug_mode() {
     303        /**
     304         * Bypass the debug mode check
     305         *
     306         * This filter should *NOT* be used by plugins. It is designed for non-web
     307         * runtimes.
     308         *
     309         * @since 4.6.0
     310         *
     311         * @ignore
     312         * @param bool True to bypass debug mode
     313         */
     314        if ( apply_filters( 'bypass_debug_mode', false ) ){
     315                return;
     316        }
     317
    288318        if ( WP_DEBUG ) {
    289319                error_reporting( E_ALL );
    290320
  • src/wp-settings.php

     
    7070// Check if we're in WP_DEBUG mode.
    7171wp_debug_mode();
    7272
     73/**
     74 * Bypass the loading of advanced-cache.php
     75 *
     76 * This filter should *NOT* be used by plugins. It is designed for non-web
     77 * runtimes.
     78 *
     79 * @since 4.6.0
     80 *
     81 * @ignore
     82 * @param bool True to bypass advanced-cache.php
     83 */
     84if ( WP_CACHE && ! apply_filters( 'bypass_advanced_cache', false )  ) {
    7385// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
    74 if ( WP_CACHE ) {
    7586        _backup_plugin_globals();
    7687        WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' );
    7788        _restore_plugin_globals();