From 2a0a6a71db52182949f52fd0f6fde965e3dbb6bb Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Wed, 3 May 2023 09:55:59 +0100 Subject: [PATCH] Use `wp_cache_flush_runtime` if supported. --- php/utils-wp.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/utils-wp.php b/php/utils-wp.php index c2d3ff82fb..97dbe9251e 100644 --- a/php/utils-wp.php +++ b/php/utils-wp.php @@ -330,6 +330,13 @@ function wp_clear_object_cache() { $wpdb->queries = []; + if ( function_exists( 'wp_cache_flush_runtime' ) && function_exists( 'wp_cache_supports' ) ) { + if ( wp_cache_supports( 'flush_runtime' ) ) { + wp_cache_flush_runtime(); + return; + } + } + if ( ! is_object( $wp_object_cache ) ) { return; }