Changeset 52707 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 02/11/2022 06:50:08 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r52669 r52707 3513 3513 $taxonomies = get_object_taxonomies( $object_type ); 3514 3514 3515 foreach ( $object_ids as $id ) { 3516 foreach ( $taxonomies as $taxonomy ) { 3517 wp_cache_delete( $id, "{$taxonomy}_relationships" ); 3518 } 3515 foreach ( $taxonomies as $taxonomy ) { 3516 wp_cache_delete_multiple( $object_ids, "{$taxonomy}_relationships" ); 3519 3517 } 3520 3518 … … 3568 3566 $taxonomies[] = $term->taxonomy; 3569 3567 $ids[] = $term->term_id; 3570 wp_cache_delete( $term->term_id, 'terms' ); 3571 } 3572 3568 } 3569 wp_cache_delete_multiple( $ids, 'terms' ); 3573 3570 $taxonomies = array_unique( $taxonomies ); 3574 3571 } else { 3572 wp_cache_delete_multiple( $ids, 'terms' ); 3575 3573 $taxonomies = array( $taxonomy ); 3576 3577 foreach ( $taxonomies as $taxonomy ) {3578 foreach ( $ids as $id ) {3579 wp_cache_delete( $id, 'terms' );3580 }3581 }3582 3574 } 3583 3575 … … 3753 3745 } 3754 3746 3747 $cache_values = array(); 3755 3748 foreach ( $object_terms as $id => $value ) { 3756 3749 foreach ( $value as $taxonomy => $terms ) { 3757 wp_cache_add( $id, $terms, "{$taxonomy}_relationships" ); 3758 } 3750 $cache_values[ $taxonomy ][ $id ] = $terms; 3751 } 3752 } 3753 foreach ( $cache_values as $taxonomy => $data ) { 3754 wp_cache_add_multiple( $data, "{$taxonomy}_relationships" ); 3759 3755 } 3760 3756 } … … 3769 3765 */ 3770 3766 function update_term_cache( $terms, $taxonomy = '' ) { 3767 $data = array(); 3771 3768 foreach ( (array) $terms as $term ) { 3772 3769 // Create a copy in case the array was passed by reference. … … 3776 3773 unset( $_term->object_id ); 3777 3774 3778 wp_cache_add( $term->term_id, $_term, 'terms' ); 3779 } 3775 $data[ $term->term_id ] = $_term; 3776 } 3777 wp_cache_add_multiple( $data, 'terms' ); 3780 3778 } 3781 3779
Note: See TracChangeset
for help on using the changeset viewer.