[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
Sun Nov 21 19:26:24 UTC 2021
#53813: Do not provide initial_edits for properties that are not supported by the
current post type.
---------------------------------------------+-----------------------
Reporter: youknowriad | Owner: audrasjb
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.9
Component: Editor | Version: 5.8
Severity: normal | Resolution: fixed
Keywords: good-first-bug has-patch commit | Focuses:
---------------------------------------------+-----------------------
Changes (by audrasjb):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"52230" 52230]:
{{{
#!CommitTicketReference repository="" revision="52230"
Editor: Do not provide `initial_edits` for properties that are not
supported by the current post type.
Previously, the block editor initialization always provided "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 leads to a bug in the post editor where as soon as one
would open a "new post", the editor considers the content "dirty", meaning
changes are applied and it is not possible to leave the editor without
encountering an "unsaved changes" notice.
This change updates the `$initial_edits` variable declaration to only
provide the properties that are supported by the current post type.
Props youknowriad, h71.
Fixes #53813.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53813#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list