From 880a3084850886087b25da9f639ea42871daa95e Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Tue, 8 Jun 2021 01:44:26 +0000 Subject: [PATCH] Boostrap/Load: Add filter to allow disabling of object cache In [37626] a filter was added to allow disabling the advanced cache dropin, but no similar filter was added for the object cache dropin. This corrects that oversight. Fixes #53322. git-svn-id: https://develop.svn.wordpress.org/trunk@51087 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/load.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 16c4b55c9a..5ba217516c 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -665,7 +665,19 @@ function wp_start_object_cache() { static $first_init = true; // Only perform the following checks once. - if ( $first_init ) { + + /** + * Filters whether to enable loading of the objectcache.php drop-in. + * + * This filter runs before it can be used by plugins. It is designed for non-web + * run-times. If false is returned, object-cache.php will never be loaded. + * + * @since 5.8.0 + * + * @param bool $enable_object_cache Whether to enable loading object-cache.php (if present). + * Default true. + */ + if ( $first_init && apply_filters( 'enable_loading_object_cache_dropin', true ) ) { if ( ! function_exists( 'wp_cache_init' ) ) { /* * This is the normal situation. First-run of this function. No