WordPress.org

Make WordPress Core

Changeset 37690


Ignore:
Timestamp:
06/12/2016 02:42:02 AM (3 years ago)
Author:
jorbin
Message:

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

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r37677 r37690  
    184184    if ( ( time() - $upgrading ) >= 600 )
    185185        return;
    186    
     186
    187187    /**
    188      * Bypass the maintenance mode check
     188     * Filters whether to enable maintenance mode.
    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 maintenance mode. 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_maintenance_mode', true, $upgrading ) ) {
     201        return;
    200202    }
    201203
     
    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
  • trunk/src/wp-settings.php

    r37626 r37690  
    7272
    7373/**
    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. If true is returned, advance-cache.php will never be loaded.
     74 * Filters whether to enable loading of the advanced-cache.php drop-in.
     75 *
     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
    82  */
    83 if ( WP_CACHE && ! apply_filters( 'bypass_advanced_cache', false )  ) {
     81 * @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present).
     82 *                                    Default true.
     83 */
     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();
Note: See TracChangeset for help on using the changeset viewer.