Use wp_cache_add() instead of wp_cache_set() when priming the object term cache in update_object_term_cache(). Pass the real post_type to clean_object_term_cache() instead of hard-coding post. Call clean_object_term_cache() from clean_bookmark_cache(). Props leewillis77. fixes #19690
git-svn-id: https://develop.svn.wordpress.org/trunk@19729 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ee4f1cfe80
commit
285247786e
@ -378,4 +378,5 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
|
|||||||
function clean_bookmark_cache( $bookmark_id ) {
|
function clean_bookmark_cache( $bookmark_id ) {
|
||||||
wp_cache_delete( $bookmark_id, 'bookmark' );
|
wp_cache_delete( $bookmark_id, 'bookmark' );
|
||||||
wp_cache_delete( 'get_bookmarks', 'bookmark' );
|
wp_cache_delete( 'get_bookmarks', 'bookmark' );
|
||||||
|
clean_object_term_cache( $bookmark_id, 'link');
|
||||||
}
|
}
|
||||||
|
@ -4330,10 +4330,12 @@ function clean_post_cache($id) {
|
|||||||
if ( 0 === $id )
|
if ( 0 === $id )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
$post = get_post( $id );
|
||||||
|
|
||||||
wp_cache_delete($id, 'posts');
|
wp_cache_delete($id, 'posts');
|
||||||
wp_cache_delete($id, 'post_meta');
|
wp_cache_delete($id, 'post_meta');
|
||||||
|
|
||||||
clean_object_term_cache($id, 'post');
|
clean_object_term_cache( $id, $post->post_type );
|
||||||
|
|
||||||
wp_cache_delete( 'wp_get_archives', 'general' );
|
wp_cache_delete( 'wp_get_archives', 'general' );
|
||||||
|
|
||||||
|
@ -2668,7 +2668,7 @@ function update_object_term_cache($object_ids, $object_type) {
|
|||||||
|
|
||||||
foreach ( $object_terms as $id => $value ) {
|
foreach ( $object_terms as $id => $value ) {
|
||||||
foreach ( $value as $taxonomy => $terms ) {
|
foreach ( $value as $taxonomy => $terms ) {
|
||||||
wp_cache_set($id, $terms, "{$taxonomy}_relationships");
|
wp_cache_add( $id, $terms, "{$taxonomy}_relationships" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user