WordPress.org

Make WordPress Core

Ticket #19690: 19690.2.diff

File 19690.2.diff, 1.8 KB (added by ryan, 6 years ago)
  • wp-includes/taxonomy.php

     
    26572657                $object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term;
    26582658
    26592659        foreach ( $ids as $id ) {
    2660                 foreach ( $taxonomies  as $taxonomy ) {
     2660                foreach ( $taxonomies as $taxonomy ) {
    26612661                        if ( ! isset($object_terms[$id][$taxonomy]) ) {
    26622662                                if ( !isset($object_terms[$id]) )
    26632663                                        $object_terms[$id] = array();
     
    26682668
    26692669        foreach ( $object_terms as $id => $value ) {
    26702670                foreach ( $value as $taxonomy => $terms ) {
    2671                         wp_cache_set($id, $terms, "{$taxonomy}_relationships");
     2671                        wp_cache_add( $id, $terms, "{$taxonomy}_relationships" );
    26722672                }
    26732673        }
    26742674}
  • wp-includes/post.php

     
    43304330        if ( 0 === $id )
    43314331                return;
    43324332
     4333        $post = get_post( $id );
     4334
    43334335        wp_cache_delete($id, 'posts');
    43344336        wp_cache_delete($id, 'post_meta');
    43354337
    4336         clean_object_term_cache($id, 'post');
     4338        clean_object_term_cache( $id, $post->post_type );
    43374339
    43384340        wp_cache_delete( 'wp_get_archives', 'general' );
    43394341
  • wp-includes/bookmark.php

     
    375375 * @since 2.7.0
    376376 * @uses wp_cache_delete() Deletes the contents of 'get_bookmarks'
    377377 */
    378 function clean_bookmark_cache($bookmark_id) {
     378function clean_bookmark_cache( $bookmark_id ) {
    379379        wp_cache_delete( $bookmark_id, 'bookmark' );
    380380        wp_cache_delete( 'get_bookmarks', 'bookmark' );
     381        clean_object_term_cache( $bookmark_id, 'link');
    381382}