Make WordPress Core


Ignore:
Timestamp:
06/12/2016 02:42:02 AM (8 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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.