Ticket #19690: 19690.diff

File 19690.diff, 404 bytes (added by leewillis77, 17 months ago)

Given that update_object_term_cache declares in its documentation that it "Will only update the cache for terms not already cached.", the attached patch amends it to call wp_cache_add instead of wp_cache_set. On reading the code this appears to make sense.

  • taxonomy.php

     
    26472647 
    26482648        foreach ( $object_terms as $id => $value ) { 
    26492649                foreach ( $value as $taxonomy => $terms ) { 
    2650                         wp_cache_set($id, $terms, "{$taxonomy}_relationships"); 
     2650                        wp_cache_add($id, $terms, "{$taxonomy}_relationships"); 
    26512651                } 
    26522652        } 
    26532653}