From de13e89608147dd34c4cdf03a3af7ddb77474857 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 12 Dec 2016 01:28:34 +0000 Subject: [PATCH] Bootstrap: Re-initialize any hooks added manually by `object-cache.php`. Prior to 3.1 if a object cache dropin wanted to add actions, they needed to use `$wp_filter` directly. Props jorbin. Fixes #39132. git-svn-id: https://develop.svn.wordpress.org/trunk@39565 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/load.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 669cf65d0b..68ed0bd1ee 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -472,6 +472,8 @@ function wp_using_ext_object_cache( $using = null ) { * @access private */ function wp_start_object_cache() { + global $wp_filter; + $first_init = false; if ( ! function_exists( 'wp_cache_init' ) ) { if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { @@ -479,6 +481,11 @@ function wp_start_object_cache() { if ( function_exists( 'wp_cache_init' ) ) { wp_using_ext_object_cache( true ); } + + // Re-initialize any hooks added manually by object-cache.php + if ( $wp_filter ) { + $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); + } } $first_init = true;