[wp-trac] [WordPress Trac] #53437: Widgets Screen: wp.editor.initialize is not a function notice
WordPress Trac
noreply at wordpress.org
Fri Jul 9 17:56:58 UTC 2021
#53437: Widgets Screen: wp.editor.initialize is not a function notice
-------------------------------------------------+-------------------------
Reporter: noisysocks | Owner: zieladam
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.8
Component: Widgets | Version:
Severity: normal | Resolution:
Keywords: has-patch commit fixed-major dev- | Focuses:
reviewed |
-------------------------------------------------+-------------------------
Comment (by desrosj):
In [changeset:"51393" 51393]:
{{{
#!CommitTicketReference repository="" revision="51393"
Widgets: Warn when `wp-editor` script or `wp-edit-post` style is enqueued
in widgets editor
It is common that plugins erroneously have `wp-editor` or `wp-edit-post`
as a
dependency in a script that is loaded in the new widgets editor. This is a
smell
since both `@wordpress/editor` and `@wordpress/edit-post` assume the
existence
of a global "post" object which the widgets editor does not have.
[51387] fixes the user-facing errors typically caused by this mistake, but
we
can go a step further and warn developers about this by calling
`_doing_it_wrong()` when we detect that the `wp-editor` script or `wp-
edit-post`
style is enqueued alongside `wp-edit-widgets` or `wp-customize-widgets`.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu, dlh,
noisysocks.
Merges [51388] to the 5.8 branch.
Fixes #53569. See #53437.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53437#comment:45>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list