Framework: Pass editor initial settings as direct argument #9921
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.
Extracted from #9403
This pull request refactors server-side editor initialization to pass initial edits as a setting directly to the editor initialization, rather than by proxy through a
window._wpGutenbergDefaultPost
global. In doing so, it resolves a yet-undiscovered issue where our filtering ofthe_title
was effectively disregarded, since we never used therendered
property of the title populating the editor. This will be further separately improved by efforts in #9403.Related to these future efforts, I think we should consider demo content as an external influencer, exposing filters necessary to provide these initial edits, in a similar fashion to what exists already with the
block_editor_settings
filter. Here's a patch which, when applied to this branch, would achieve this. However, I am choosing to defer this to after #9403, as it is not my desire for theraw
/rendered
distinction of content attributes persist, and thus be exposed into a public interface for extending initial edits.Testing instructions:
Verify there are no regressions in the behavior of initial edits, notably:
the_title
filterHere's a small plugin for testing
the_title
:(Note:
the_title
is not an editor-specific filter, so it will have additional side-effects to leave the above plugin activated after testing)