[wp-trac] [WordPress Trac] #53437: Widgets Screen: wp.editor.initialize is not a function notice

WordPress Trac noreply at wordpress.org
Fri Jul 9 01:17:56 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  |     Focuses:
------------------------------+-----------------------

Comment (by noisysocks):

 In [changeset:"51388" 51388]:
 {{{
 #!CommitTicketReference repository="" revision="51388"
 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`.

 See #53437.
 Fixes #53569.
 Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu, dlh.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53437#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list