Clear the object term relationships cache in wp_set_object_terms() rather than wp_set_post_terms(). This should be done lower in the stack than wp_set_post_terms().

Props batmoo
fixes #22560


git-svn-id: https://develop.svn.wordpress.org/trunk@22878 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-11-27 19:42:38 +00:00
parent bccdaa137d
commit bf812ac283
2 changed files with 3 additions and 7 deletions
+1 -7
View File
@@ -3196,13 +3196,7 @@ function wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $a
$tags = array_unique( array_map( 'intval', $tags ) );
}
$r = wp_set_object_terms( $post_id, $tags, $taxonomy, $append );
if ( is_wp_error( $r ) )
return $r;
wp_cache_delete( $post_id, $taxonomy . '_relationships' );
return $r;
return wp_set_object_terms( $post_id, $tags, $taxonomy, $append );
}
/**