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
This commit is contained in:
Sergey Biryukov 2019-12-02 14:47:27 +00:00
parent 8917973d52
commit 9440ad966b
1 changed files with 7 additions and 10 deletions

View File

@ -1286,7 +1286,6 @@ function get_category_children( $id, $before = '/', $after = '', $visited = arra
function get_all_category_ids() { function get_all_category_ids() {
_deprecated_function( __FUNCTION__, '4.0.0', 'get_terms()' ); _deprecated_function( __FUNCTION__, '4.0.0', 'get_terms()' );
if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
$cat_ids = get_terms( $cat_ids = get_terms(
array( array(
'taxonomy' => 'category', 'taxonomy' => 'category',
@ -1294,8 +1293,6 @@ function get_all_category_ids() {
'get' => 'all', 'get' => 'all',
) )
); );
wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
}
return $cat_ids; return $cat_ids;
} }