When posts/terms are deleted/trashed, update associated menu items. Deleted post = deleted menu item, trashed post = menu item becomes a draft. props filosofo, see #13174

git-svn-id: https://develop.svn.wordpress.org/trunk@14295 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-04-29 07:33:56 +00:00
parent 4defadbe97
commit 5dbf47294f
6 changed files with 153 additions and 17 deletions

View File

@@ -2167,7 +2167,7 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
} elseif ( !empty($post_parent) ) {
$parent_post = get_post($post_parent);
// Check for circular dependency
if ( $parent_post->post_parent == $post_ID )
if ( isset( $parent_post->post_parent ) && $parent_post->post_parent == $post_ID )
$post_parent = 0;
}
}