From 5190ccce93f6f87a186f434621178dfc485c9fc1 Mon Sep 17 00:00:00 2001 From: Nirav Sherasiya Date: Thu, 12 Oct 2023 10:11:07 +0530 Subject: [PATCH] Remove: taxonomy args from cache key generation arge of taxonomy are remove from the function generate_cache_key to generate the cache key for class WP_Term_Query. the taxonomies are stored in the arguments used to generate the $cache_args variable. --- src/wp-includes/class-wp-term-query.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-term-query.php b/src/wp-includes/class-wp-term-query.php index fc6e950c219cb..a76b38f0cbf12 100644 --- a/src/wp-includes/class-wp-term-query.php +++ b/src/wp-includes/class-wp-term-query.php @@ -1170,12 +1170,11 @@ protected function generate_cache_key( array $args, $sql ) { if ( 'count' !== $args['fields'] && 'all_with_object_id' !== $args['fields'] ) { $cache_args['fields'] = 'all'; } - $taxonomies = (array) $args['taxonomy']; // Replace wpdb placeholder in the SQL statement used by the cache key. $sql = $wpdb->remove_placeholder_escape( $sql ); - $key = md5( serialize( $cache_args ) . serialize( $taxonomies ) . $sql ); + $key = md5( serialize( $cache_args ) . $sql ); $last_changed = wp_cache_get_last_changed( 'terms' ); return "get_terms:$key:$last_changed"; }