Plugin: Deprecate window._wpLoadGutenbergEditor #13547
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.
This pull request seeks to deprecate
window._wpLoadGutenbergEditor
in favor of the core-definedwindow._wpLoadBlockEditor
. At this time,_wpLoadBlockEditor
is in-fact defined by Gutenberg, but in subsequent revisions it will be dropped in favor of relying on the core behavior instead.This is a private API and was not intended to be used by plugins, but is proposed to undergo the standard deprecation lifetime, since it's been seen to be used by plugins to act on the editor upon its being loaded.
Ideally a plugin should never use this promise, leveraging instead (depending on their use):
Testing instructions:
Verify there are no regressions in the loading of the editor, and no console warnings by default.
Verify that by attempting to reference the
_wpLoadGutenbergEditor
global variable, it (a) logs to the console and (b) still works as intended.(Depending on your browser, the logging may occur without actually pressing Enter in your Developer Tools Console. For example, Chrome evaluates the variable before it's run, triggering the getter behavior to log the warning)