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..06762ec 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; |
… |
… |
|
2808 | 2808 | * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. |
2809 | 2809 | */ |
2810 | 2810 | function get_object_term_cache($id, $taxonomy) { |
| 2811 | $taxonomy = _get_taxonomy_cache_key( $taxonomy ); |
2811 | 2812 | $cache = wp_cache_get($id, "{$taxonomy}_relationships"); |
2812 | 2813 | return $cache; |
2813 | 2814 | } |
… |
… |
|
2844 | 2845 | $object_ids = array_map('intval', $object_ids); |
2845 | 2846 | |
2846 | 2847 | $taxonomies = get_object_taxonomies($object_type); |
| 2848 | $taxonomy_key = _get_taxonomy_cache_key( $taxonomies ); |
2847 | 2849 | |
2848 | 2850 | $ids = array(); |
2849 | 2851 | 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 | | } |
| 2852 | if ( false === wp_cache_get($id, "{$taxonomy_key}_relationships") ) { |
| 2853 | $ids[] = $id; |
| 2854 | break; |
2855 | 2855 | } |
2856 | 2856 | } |
2857 | 2857 | |
… |
… |
|
2865 | 2865 | $object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term; |
2866 | 2866 | |
2867 | 2867 | 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 | | } |
| 2868 | if ( ! isset($object_terms[$id][$taxonomy_key]) ) { |
| 2869 | if ( !isset($object_terms[$id]) ) |
| 2870 | $object_terms[$id] = array(); |
| 2871 | $object_terms[$id][$taxonomy_key] = array(); |
2874 | 2872 | } |
2875 | 2873 | } |
2876 | 2874 | |
2877 | 2875 | foreach ( $object_terms as $id => $value ) { |
2878 | | foreach ( $value as $taxonomy => $terms ) { |
2879 | | wp_cache_add( $id, $terms, "{$taxonomy}_relationships" ); |
2880 | | } |
| 2876 | wp_cache_add( $id, $terms, "{$taxonomy_key}_relationships" ); |
2881 | 2877 | } |
2882 | 2878 | } |
2883 | 2879 | |
… |
… |
|
3458 | 3454 | |
3459 | 3455 | return $parent; |
3460 | 3456 | } |
| 3457 | |
| 3458 | function _get_taxonomy_cache_key( $taxonomy = '' ) { |
| 3459 | if ( is_array( $taxonomy ) ) { |
| 3460 | $taxonomy_key = implode( '_', $taxonomy ); |
| 3461 | } else { |
| 3462 | $taxonomy_key = $taxonomy; |
| 3463 | } |
| 3464 | return $taxonomy_key; |
| 3465 | } |
| 3466 | |