diff --git a/wp-includes/functions.php b/wp-includes/functions.php index db4fbf2a3b..44728a2e41 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -8600,7 +8600,8 @@ function recurse_dirsize( $directory, $exclude = null, $max_execution_time = nul // Only write the transient on the top level call and not on recursive calls. if ( $save_cache ) { - set_transient( 'dirsize_cache', $directory_cache ); + $expiration = ( wp_using_ext_object_cache() ) ? 0 : 10 * YEAR_IN_SECONDS; + set_transient( 'dirsize_cache', $directory_cache, $expiration ); } return $size; @@ -8635,12 +8636,13 @@ function clean_dirsize_cache( $path ) { return; } + $expiration = ( wp_using_ext_object_cache() ) ? 0 : 10 * YEAR_IN_SECONDS; if ( ! str_contains( $path, '/' ) && ! str_contains( $path, '\\' ) ) { unset( $directory_cache[ $path ] ); - set_transient( 'dirsize_cache', $directory_cache ); + set_transient( 'dirsize_cache', $directory_cache, $expiration ); return; } @@ -8659,7 +8661,7 @@ function clean_dirsize_cache( $path ) { unset( $directory_cache[ $path ] ); } - set_transient( 'dirsize_cache', $directory_cache ); + set_transient( 'dirsize_cache', $directory_cache, $expiration ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 44fad9eae7..29b1bb9e42 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56521'; +$wp_version = '6.4-alpha-56522'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.