Accept a post object in clean_post_cache(). Fixes #20486.

The post_type can then be accessed to properly clean the taxonomy relationships cache.
The full object is useful in situations when an ID might reference a post that has been
removed from the database (e.g. wp_delete_post()).


git-svn-id: https://develop.svn.wordpress.org/trunk@20569 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jon Cave
2012-04-23 22:04:35 +00:00
parent 5b9e7c07ba
commit 83a3cc73df
4 changed files with 26 additions and 28 deletions
@@ -360,7 +360,7 @@ class WP_Posts_List_Table extends WP_List_Table {
if ( $page->post_parent == $page->ID ) {
$page->post_parent = 0;
$wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) );
clean_post_cache( $page->ID, $page->post_type );
clean_post_cache( $page );
}
if ( 0 == $page->post_parent )