Ticket #34803: 34803.diff
File 34803.diff, 1.1 KB (added by , 9 years ago) |
---|
-
src/wp-includes/post.php
2409 2409 $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => $post->post_type ) ); 2410 2410 } 2411 2411 2412 if ( $post->post_type == 'nav_menu_item') { 2413 // Get this menu item's parent 2414 $parent_menu_id = (int)get_post_meta ( $post->ID, '_menu_item_menu_item_parent', true ); 2415 2416 // Move all children of this nav menu to the parent 2417 $children_query = $wpdb->prepare("UPDATE $wpdb->postmeta SET meta_value = %d WHERE meta_key = '_menu_item_menu_item_parent' AND meta_value=%s", $parent_menu_id, $post->ID); 2418 $children = $wpdb->query ( $children_query ); 2419 } 2420 2412 2421 // Do raw query. wp_get_post_revisions() is filtered. 2413 2422 $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) ); 2414 2423 // Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.