Skip to content

Commit

Permalink
Boostrap/Load: Add filter to allow disabling of object cache
Browse files Browse the repository at this point in the history
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.

Built from https://develop.svn.wordpress.org/trunk@51087


git-svn-id: http://core.svn.wordpress.org/trunk@50696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
aaronjorbin committed Jun 8, 2021
1 parent e53ace6 commit f3dc033
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-51086';
$wp_version = '5.8-alpha-51087';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit f3dc033

Please sign in to comment.