diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 0163008d17..97345331de 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -768,13 +768,20 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) 'post_type' => $post_type, 'post_status' => 'auto-draft', ), - false, + true, false ); - $post = get_post( $post_id ); + + if ( is_wp_error( $post_id ) ) { + wp_die( $post_id->get_error_message() ); + } + + $post = get_post( $post_id ); + if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) { set_post_format( $post, get_option( 'default_post_format' ) ); } + wp_after_insert_post( $post, false, null ); // Schedule auto-draft cleanup. diff --git a/wp-includes/version.php b/wp-includes/version.php index c855bc32b9..ca44c1c024 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60700'; +$wp_version = '6.9-alpha-60701'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.