Skip to content

Commit

Permalink
Changes from lib/navigation.php
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Nov 15, 2021
1 parent 81b5daf commit c7ca187
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/wp-includes/navigation-areas.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ function _wp_migrate_menu_to_navigation_post( $new_name, WP_Theme $new_theme, WP
'post_content' => serialize_blocks( $parsed_blocks ),
'post_status' => 'publish',
);
$navigation_post_id = wp_insert_post( $post_data );
$navigation_post_id = wp_insert_post( $post_data, true );
// If wp_insert_post fails *at any time*, then bail out of the
// entire migration attempt returning the WP_Error object.
if ( is_wp_error( $navigation_post_id ) ) {
return $navigation_post_id;
}
}

$area_mapping[ $location_name ] = $navigation_post_id;
Expand Down

0 comments on commit c7ca187

Please sign in to comment.