diff --git a/wp-includes/load.php b/wp-includes/load.php index b2181c0a2d..9ab44f018f 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -183,6 +183,21 @@ function wp_maintenance() { // If the $upgrading timestamp is older than 10 minutes, don't die. if ( ( time() - $upgrading ) >= 600 ) return; + + /** + * Bypass the maintenance mode check + * + * This filter should *NOT* be used by plugins. It is designed for non-web + * runtimes. If this filter returns true, maintenance mode will not be + * active which can cause problems during updates for web site views. + * + * @since 4.6.0 + * + * @param bool True to bypass maintenance + */ + if ( apply_filters( 'bypass_maintenance_mode', false ) ){ + return; + } if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { require_once( WP_CONTENT_DIR . '/maintenance.php' ); @@ -285,6 +300,22 @@ function timer_stop( $display = 0, $precision = 3 ) { * @access private */ function wp_debug_mode() { + /** + * Bypass the debug mode check + * + * This filter should *NOT* be used by plugins. It is designed for non-web + * runtimes. Returning true causes the WP_DEBUG and related constants to + * not be checked and the default php values for errors will be used unless + * you take care to update them yourself. + * + * @since 4.6.0 + * + * @param bool True to bypass debug mode + */ + if ( apply_filters( 'bypass_debug_mode', false ) ){ + return; + } + if ( WP_DEBUG ) { error_reporting( E_ALL ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 42aac6dde0..391d4949e2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37625'; +$wp_version = '4.6-alpha-37626'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-settings.php b/wp-settings.php index 8beee6fdb8..e139f07d92 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -70,8 +70,18 @@ timer_start(); // Check if we're in WP_DEBUG mode. wp_debug_mode(); +/** + * Bypass the loading of advanced-cache.php + * + * This filter should *NOT* be used by plugins. It is designed for non-web + * runtimes. If true is returned, advance-cache.php will never be loaded. + * + * @since 4.6.0 + * + * @param bool True to bypass advanced-cache.php + */ +if ( WP_CACHE && ! apply_filters( 'bypass_advanced_cache', false ) ) { // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. -if ( WP_CACHE ) { _backup_plugin_globals(); WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); _restore_plugin_globals();