From 9440ad966b0d63871792e7c933182750a7d22bba Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 2 Dec 2019 14:47:27 +0000 Subject: [PATCH] Taxonomy: Remove redundant caching from `get_all_category_ids()`, deprecated in favor of `get_terms()` in [28679]. The `all_category_ids` cache key it relied on was removed in [5555] and never repopulated, causing invalid or unexpected results when using a persistent object cache. Props itowhid06, johnjamesjacoby. Fixes #48176. git-svn-id: https://develop.svn.wordpress.org/trunk@46810 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/deprecated.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php index 98da670cc1..9230525b3c 100644 --- a/src/wp-includes/deprecated.php +++ b/src/wp-includes/deprecated.php @@ -1286,16 +1286,13 @@ function get_category_children( $id, $before = '/', $after = '', $visited = arra function get_all_category_ids() { _deprecated_function( __FUNCTION__, '4.0.0', 'get_terms()' ); - if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) { - $cat_ids = get_terms( - array( - 'taxonomy' => 'category', - 'fields' => 'ids', - 'get' => 'all', - ) - ); - wp_cache_add( 'all_category_ids', $cat_ids, 'category' ); - } + $cat_ids = get_terms( + array( + 'taxonomy' => 'category', + 'fields' => 'ids', + 'get' => 'all', + ) + ); return $cat_ids; }