Changeset 52230
- Timestamp:
- 11/21/2021 07:26:08 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-blocks.php
r51962 r52230 78 78 * but should be included in its save payload. 79 79 */ 80 $initial_edits = null;80 $initial_edits = array(); 81 81 $is_new_post = false; 82 82 if ( 'auto-draft' === $post->post_status ) { 83 83 $is_new_post = true; 84 84 // Override "(Auto Draft)" new post default title with empty string, or filtered value. 85 $initial_edits = array( 86 'title' => $post->post_title, 87 'content' => $post->post_content, 88 'excerpt' => $post->post_excerpt, 89 ); 85 if ( post_type_supports( $post->post_type, 'title' ) ) { 86 $initial_edits['title'] = $post->post_title; 87 } 88 89 if ( post_type_supports( $post->post_type, 'content' ) ) { 90 $initial_edits['content'] = $post->post_content; 91 } 92 93 if ( post_type_supports( $post->post_type, 'excerpt' ) ) { 94 $initial_edits['excerpt'] = $post->post_excerpt; 95 } 90 96 } 91 97
Note: See TracChangeset
for help on using the changeset viewer.