diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 969d138ecb..1ed9fb0792 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -77,16 +77,22 @@ wp_add_inline_script( * Assign initial edits, if applicable. These are not initially assigned to the persisted post, * but should be included in its save payload. */ -$initial_edits = null; +$initial_edits = array(); $is_new_post = false; if ( 'auto-draft' === $post->post_status ) { $is_new_post = true; // Override "(Auto Draft)" new post default title with empty string, or filtered value. - $initial_edits = array( - 'title' => $post->post_title, - 'content' => $post->post_content, - 'excerpt' => $post->post_excerpt, - ); + if ( post_type_supports( $post->post_type, 'title' ) ) { + $initial_edits['title'] = $post->post_title; + } + + if ( post_type_supports( $post->post_type, 'content' ) ) { + $initial_edits['content'] = $post->post_content; + } + + if ( post_type_supports( $post->post_type, 'excerpt' ) ) { + $initial_edits['excerpt'] = $post->post_excerpt; + } } // Preload server-registered block schemas.