Bootstrap/Load. Adjust filters added in [37626].

These adjustments improve the documentation for the filters and adjust the names make them more consistent with other filters already in core.

See #34936.
Props DrewAPicture, ocean90, jorbin

Built from https://develop.svn.wordpress.org/trunk@37690


git-svn-id: http://core.svn.wordpress.org/trunk@37656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin 2016-06-12 02:43:27 +00:00
parent 2cd62a2c97
commit c918c1ede1
3 changed files with 25 additions and 22 deletions

View File

@ -183,20 +183,22 @@ 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
* Filters whether to enable maintenance mode.
*
* 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.
* This filter runs before it can be used by plugins. It is designed for
* non-web runtimes. If this filter returns true, maintenance mode will be
* active and the request will end. If false, the request will be allowed to
* continue processing even if maintenance mode should be active.
*
* @since 4.6.0
*
* @param bool True to bypass maintenance
* @param bool $enable_checks Whether to enable maintenance mode. Default true.
* @param int $upgrading The timestamp set in the .maintenance file.
*/
if ( apply_filters( 'bypass_maintenance_mode', false ) ){
return;
if ( ! apply_filters( 'enable_maintenance_mode', true, $upgrading ) ) {
return;
}
if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
@ -301,19 +303,19 @@ function timer_stop( $display = 0, $precision = 3 ) {
*/
function wp_debug_mode() {
/**
* Bypass the debug mode check
* Filters whether to allow the debug mode check to occur.
*
* 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.
* This filter runs before it can be used by plugins. It is designed for
* non-web run-times. Returning false 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
* @param bool $enable_debug_mode Whether to enable debug mode checks to occur. Default true.
*/
if ( apply_filters( 'bypass_debug_mode', false ) ){
return;
if ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ){
return;
}
if ( WP_DEBUG ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37689';
$wp_version = '4.6-alpha-37690';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -71,16 +71,17 @@ timer_start();
wp_debug_mode();
/**
* Bypass the loading of advanced-cache.php
* Filters whether to enable loading of the advanced-cache.php drop-in.
*
* 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.
* This filter runs before it can be used by plugins. It is designed for non-web
* run-times. If false is returned, advance-cache.php will never be loaded.
*
* @since 4.6.0
*
* @param bool True to bypass advanced-cache.php
* @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present).
* Default true.
*/
if ( WP_CACHE && ! apply_filters( 'bypass_advanced_cache', false ) ) {
if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) ) {
// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
_backup_plugin_globals();
WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' );