Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 38699)
+++ src/wp-includes/post.php	(working copy)
@@ -5741,6 +5741,13 @@
 		if ( '' == get_the_guid($post->ID) )
 			$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
 
+		if( is_post_type_hierarchical( $post->post_type ) ) {
+			$child_posts = get_posts( array( 'meta_key' => '_wp_post_parent_fallback', 'meta_value' => $post->ID, 'post_type' => $post->post_type ) );
+			if( 0 < count( $child_posts ) ) {
+				array_map( 'wp_update_post', array_map( '__restore_post_parent', $child_posts ) );
+			}
+		}
+
 		/**
 		 * Fires when a post's status is transitioned from private to published.
 		 *
@@ -5750,6 +5757,11 @@
 		 * @param int $post_id Post ID.
 		 */
 		do_action('private_to_published', $post->ID);
+	} elseif( 'publish' !== $new_status && 'publish' === $old_status && is_post_type_hierarchical( $post->post_type ) ) {
+		$child_posts = get_posts( array( 'post_parent' => $post->ID, 'post_status' => 'any', 'post_type' => $post->post_type ) );
+		if( 0 < count( $child_posts ) ) {
+			array_map( 'wp_update_post', array_map( '__unset_post_parent', $child_posts ) );
+		}
 	}
 
 	// If published posts changed clear the lastpostmodified cache.
@@ -5771,6 +5783,34 @@
 }
 
 /**
+ * Function to set post parent to none.
+ *
+ * @param WP_Post $post    Post object.
+ *
+ * @return WP_Post $post    Modified post object.
+ */
+function __unset_post_parent( $post ) {
+	update_post_meta( $post->ID, '_wp_post_parent_fallback', $post->post_parent );
+	$post->post_parent = 0;
+
+	return apply_filters( 'wp_unset_post_parent', $post );
+}
+
+/**
+ * Function to reset post parent to prev.
+ *
+ * @param WP_Post $post    Post object.
+ *
+ * @return WP_Post $post    Modified post object.
+ */
+function __restore_post_parent( $post ) {
+	$post->post_parent = get_post_meta( $post->ID, '_wp_post_parent_fallback', true );
+	delete_post_meta( $post->ID, '_wp_post_parent_fallback' );
+
+	return apply_filters( 'wp_restore_post_parent', $post );
+}
+
+/**
  * Hook used to schedule publication for a post marked for the future.
  *
  * The $post properties used and must exist are 'ID' and 'post_date_gmt'.
