Make WordPress Core

Changeset 46810


Ignore:
Timestamp:
12/02/2019 02:47:27 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r46290 r46810  
    12871287        _deprecated_function( __FUNCTION__, '4.0.0', 'get_terms()' );
    12881288
    1289         if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
    1290                 $cat_ids = get_terms(
    1291                         array(
    1292                                 'taxonomy' => 'category',
    1293                                 'fields'   => 'ids',
    1294                                 'get'      => 'all',
    1295                         )
    1296                 );
    1297                 wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
    1298         }
     1289        $cat_ids = get_terms(
     1290                array(
     1291                        'taxonomy' => 'category',
     1292                        'fields'   => 'ids',
     1293                        'get'      => 'all',
     1294                )
     1295        );
    12991296
    13001297        return $cat_ids;
Note: See TracChangeset for help on using the changeset viewer.