WordPress.org

Make WordPress Core

Ticket #24189: 24189.diff

File 24189.diff, 559 bytes (added by westi, 12 months ago)

Add a simple freshen of the term info during the get_object_term_cache call.

  • wp-includes/taxonomy.php

     
    27342734 */ 
    27352735function get_object_term_cache($id, $taxonomy) { 
    27362736        $cache = wp_cache_get($id, "{$taxonomy}_relationships"); 
    2737         return $cache; 
     2737        $freshened_cache = false; 
     2738        if ( $cache ) { 
     2739                foreach ( $cache as $key => $maybe_stale ) { 
     2740                        $freshened_cache[$key] = get_term( $maybe_stale->term_id, $taxonomy ); 
     2741                } 
     2742        } 
     2743        return $freshened_cache; 
    27382744} 
    27392745 
    27402746/**