mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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: http://svn.automattic.com/wordpress/trunk@19729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ed8c96636c
commit
4cf5450a81
@ -378,4 +378,5 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
|
||||
function clean_bookmark_cache( $bookmark_id ) {
|
||||
wp_cache_delete( $bookmark_id, '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 )
|
||||
return;
|
||||
|
||||
$post = get_post( $id );
|
||||
|
||||
wp_cache_delete($id, 'posts');
|
||||
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' );
|
||||
|
||||
|
@ -2668,7 +2668,7 @@ function update_object_term_cache($object_ids, $object_type) {
|
||||
|
||||
foreach ( $object_terms as $id => $value ) {
|
||||
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