[wp-trac] [WordPress Trac] #53813: Do not provide initial_edits for properties that are not supported by the current post type.

WordPress Trac noreply at wordpress.org
Wed Jul 28 12:29:23 UTC 2021


#53813: Do not provide initial_edits for properties that are not supported by the
current post type.
--------------------------+----------------------------
 Reporter:  youknowriad   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  5.9
Component:  Editor        |    Version:  5.8
 Severity:  normal        |   Keywords:  good-first-bug
  Focuses:                |
--------------------------+----------------------------
 I noticed that edit-form-blocks.php (block editor initialization) always
 provides "title", "content" and "excerpt" initial edits in the
 `initializeEditor` call even though these properties might not be
 supported by the current post type being edited.

 This creates a subtle bug in the post editor where as soon as you open a
 "new post", the editor considers the content "dirty", meaning changes are
 applied and you can't "leave" the editor without having the "unsaved
 changes" notice.

 I think we should consider updating the $initial_edits variable
 declaration to only add the properties that are supported by the current
 CPT.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53813>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list