Make WordPress Core


Ignore:
Timestamp:
05/26/2016 04:49:10 AM (8 years ago)
Author:
boonebgorges
Message:

Store only term IDs in object term relationships caches.

Previously, objects containing all data about a term were stored in each
object's term cache. Besides being wasteful, this approach caused invalidation
issues, as when a modified term count required a flush for all objects
belonging to the term.

Backward compatibility is maintained for plugins that continue to put object
data directly into the {$taxonomy}_relationships cache bucket.

Fixes #36814.

File:
1 edited

Legend:

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

    r37488 r37573  
    243243    if ( false === $terms ) {
    244244        $terms = wp_get_object_terms( $post_id, $taxonomy );
    245         wp_cache_add( $post_id, $terms, $taxonomy . '_relationships' );
     245        wp_cache_add( $post_id, wp_list_pluck( $terms, 'term_id' ), $taxonomy . '_relationships' );
    246246    }
    247247
Note: See TracChangeset for help on using the changeset viewer.