From 356b9ebdc2b3fae4326c74b77a39d295eb912d50 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 29 Nov 2016 05:38:16 +0000 Subject: [PATCH] WP_Hook: Re-initialize any actions added directly to `$wp_filter` by `advanced-cache.php`. Props dd32, ocean90. Merges [39369] to the 4.7 branch. Fixes #38929. git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39370 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-settings.php b/src/wp-settings.php index 9fe4080f3f..8dd0f40317 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -80,8 +80,13 @@ wp_debug_mode(); * Default true. */ 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. + // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); + + // Re-initialize any hooks added manually by advanced-cache.php + if ( $wp_filter ) { + $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); + } } // Define WP_LANG_DIR if not set.