diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index 57f7cb9..258b397 100644
a
|
b
|
|
1088 | 1088 | $terms = get_object_term_cache( $post->ID, $taxonomy ); |
1089 | 1089 | if ( false === $terms ) { |
1090 | 1090 | $terms = wp_get_object_terms( $post->ID, $taxonomy ); |
1091 | | wp_cache_add($post->ID, $terms, $taxonomy . '_relationships'); |
| 1091 | wp_cache_add($post->ID, $terms, _get_taxonomy_cache_key( $taxonomy ) . '_relationships'); |
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | $terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy ); |
… |
… |
|
1127 | 1127 | $term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>'; |
1128 | 1128 | } |
1129 | 1129 | |
1130 | | $term_links = apply_filters( "term_links-$taxonomy", $term_links ); |
| 1130 | $taxonomy_key = _get_taxonomy_cache_key( $taxonomy ); |
| 1131 | $term_links = apply_filters( "term_links-$taxonomy_key", $term_links ); |
1131 | 1132 | |
1132 | 1133 | return $before . join( $sep, $term_links ) . $after; |
1133 | 1134 | } |
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 06a9126..c3f6b4d 100644
a
|
b
|
|
2317 | 2317 | return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database' ), $wpdb->last_error ); |
2318 | 2318 | } |
2319 | 2319 | |
2320 | | wp_cache_delete( $object_id, $taxonomy . '_relationships' ); |
| 2320 | wp_cache_delete( $object_id, _get_taxonomy_cache_key( $taxonomy ) . '_relationships' ); |
2321 | 2321 | |
2322 | 2322 | do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids); |
2323 | 2323 | return $tt_ids; |
… |
… |
|
2726 | 2726 | $object_ids = array($object_ids); |
2727 | 2727 | |
2728 | 2728 | $taxonomies = get_object_taxonomies( $object_type ); |
| 2729 | $taxonomy = _get_taxonomy_cache_key( $taxonomies ); |
2729 | 2730 | |
2730 | | foreach ( $object_ids as $id ) |
2731 | | foreach ( $taxonomies as $taxonomy ) |
2732 | | wp_cache_delete($id, "{$taxonomy}_relationships"); |
| 2731 | foreach ( $object_ids as $id ) { |
| 2732 | wp_cache_delete( $id, "{$taxonomy}_relationships" ); |
| 2733 | } |
2733 | 2734 | |
2734 | 2735 | do_action('clean_object_term_cache', $object_ids, $object_type); |
2735 | 2736 | } |
… |
… |
|
2808 | 2809 | * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. |
2809 | 2810 | */ |
2810 | 2811 | function get_object_term_cache($id, $taxonomy) { |
| 2812 | $taxonomy = _get_taxonomy_cache_key( $taxonomy ); |
2811 | 2813 | $cache = wp_cache_get($id, "{$taxonomy}_relationships"); |
2812 | 2814 | return $cache; |
2813 | 2815 | } |
… |
… |
|
2844 | 2846 | $object_ids = array_map('intval', $object_ids); |
2845 | 2847 | |
2846 | 2848 | $taxonomies = get_object_taxonomies($object_type); |
| 2849 | $taxonomy_key = _get_taxonomy_cache_key( $taxonomies ); |
2847 | 2850 | |
2848 | 2851 | $ids = array(); |
2849 | 2852 | foreach ( (array) $object_ids as $id ) { |
2850 | | foreach ( $taxonomies as $taxonomy ) { |
2851 | | if ( false === wp_cache_get($id, "{$taxonomy}_relationships") ) { |
2852 | | $ids[] = $id; |
2853 | | break; |
2854 | | } |
| 2853 | if ( false === wp_cache_get($id, "{$taxonomy_key}_relationships") ) { |
| 2854 | $ids[] = $id; |
| 2855 | break; |
2855 | 2856 | } |
2856 | 2857 | } |
2857 | 2858 | |
… |
… |
|
2865 | 2866 | $object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term; |
2866 | 2867 | |
2867 | 2868 | foreach ( $ids as $id ) { |
2868 | | foreach ( $taxonomies as $taxonomy ) { |
2869 | | if ( ! isset($object_terms[$id][$taxonomy]) ) { |
2870 | | if ( !isset($object_terms[$id]) ) |
2871 | | $object_terms[$id] = array(); |
2872 | | $object_terms[$id][$taxonomy] = array(); |
2873 | | } |
| 2869 | if ( ! isset($object_terms[$id][$taxonomy_key]) ) { |
| 2870 | if ( !isset($object_terms[$id]) ) |
| 2871 | $object_terms[$id] = array(); |
| 2872 | $object_terms[$id][$taxonomy_key] = array(); |
2874 | 2873 | } |
2875 | 2874 | } |
2876 | 2875 | |
2877 | 2876 | foreach ( $object_terms as $id => $value ) { |
2878 | | foreach ( $value as $taxonomy => $terms ) { |
2879 | | wp_cache_add( $id, $terms, "{$taxonomy}_relationships" ); |
2880 | | } |
| 2877 | wp_cache_add( $id, $terms, "{$taxonomy_key}_relationships" ); |
2881 | 2878 | } |
2882 | 2879 | } |
2883 | 2880 | |