Plugin: Avoid setting generic "Edit Post" title on load #13552
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously: #8831 (786de1e)
This pull request seeks to remove special handling for the admin screen's
<title>
element by Gutenberg. As part of removing client-side title handling in #8831, logic was added to explicitly assign "Edit Post" (or as defined by custom post type label) as the title of the screen, regardless whether the user was adding a new post or editing an existing one. Presumably this was added to account for the fact that due to the lack of full page reload on save, a user would seamlessly transition from the state of adding a new post to editing an existing one.However, this behavior was never incorporated into WordPress 5.0, and in retrospect, I don't know that it adds much value. To me, there is likely to be little confusion caused from a user seeing "Add New Post" in the title of a screen if they had in-fact started their editing session by creating a new post. In any case, an enhancement here should probably be proposed to core proper, as most PHP is being removed from the Gutenberg plugin when deferring to core is possible.
Testing instructions:
Verify that page titles of the post editor, both in adding a new post and editing an existing one, align between the Gutenberg plugin and in the block editor provided through WordPress 5.0.
Specifically, a new post should show "Add New Post", and editing an existing post should show "Edit Post".