Make WordPress Core


Ignore:
Timestamp:
08/13/2016 04:01:09 PM (8 years ago)
Author:
jorbin
Message:

Bootstrap/Load: Revert Plugin Global restoration around advance-cache.php.

Merges [38251] to the 4.6 branch.

First added in [37588] and later modified in [38224], the idea was to ensure that filters/actions added before advance-cache.php would not disappear if advance-cache.php overloaded the filters/actions with code such as $wp_filter = array(). This is an edge case and one that there is no documented case of existing.

This restores the behavior from WordPress 4.5 and before. It is strongly encouraged that developers using advance-cache.php to use the Plugins API that is available before the loading of advance-cache.php rather than directly interacting with any of the globals.

Props azaozz, jorbin, dd32 for review, pento for review, westi for investigation, ipstenu for research.

See #36819.

Location:
branches/4.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.6

  • branches/4.6/src/wp-settings.php

    r38224 r38252  
    8484if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) ) {
    8585// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
    86     _backup_plugin_globals( true );
    8786    WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' );
    88     _restore_plugin_globals();
    8987}
    9088
Note: See TracChangeset for help on using the changeset viewer.