Title: wp_enqueue_script() was called incorrectly. &#8220;wp-editor&#8221;
Last modified: March 14, 2022

---

# wp_enqueue_script() was called incorrectly. “wp-editor”

 *  Resolved [Carret](https://wordpress.org/support/users/carret/)
 * (@carret)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/)
 * Hi,
 * this notice can be seen in the widget block editor:
 * Notice: wp_enqueue_script() was called incorrectly. “wp-editor” script should
   not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-
   widgets). Please see Debugging in WordPress for more information. (This message
   was added in version 5.8.0.) in /opt/lampp/htdocs/testsite/wp-includes/functions.
   php on line 5768
 * When this plugin is disabled the notice disappears (WP 5.9.2 and The Events Calendar
   Shortcode & Block v2.5.2).

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Brian Hogg](https://wordpress.org/support/users/brianhogg/)
 * (@brianhogg)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/#post-15457360)
 * Hi [@carret](https://wordpress.org/support/users/carret/) ,
 * Thanks for the note! I’m not able to replicate this notice, so it may have something
   to do with the theme. Have you tried using a default theme like TwentyTwenty 
   to see if the notice still appears? Ensure you have a backup of the site before
   switching themes just in case.
 * Also, is this notice appearing in the editor before you try to add the shortcode
   or block to the widget area, or after? Does it go away after you delete any blocks
   with the shortcode in it? The more detail on the steps to reproduce the better.
 * Cheers!
 *  Thread Starter [Carret](https://wordpress.org/support/users/carret/)
 * (@carret)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/#post-15457863)
 * The error appears before and after using the shortcode or the block. And it keeps
   appearing even if I delete them.
 * I have found that this notice occurs with ‘wp-editor’ in wp_register_script().
 * And I found here the source of the problem and the solution:
 * [https://wordpress.org/support/topic/error-in-widgets-with-new-wordpress-version-5-8-wp_enqueue_script-and-wp/#post-15090381](https://wordpress.org/support/topic/error-in-widgets-with-new-wordpress-version-5-8-wp_enqueue_script-and-wp/#post-15090381)
 * > [The Block Editor JavaScript module in 5.2](https://make.wordpress.org/core/2019/04/09/the-block-editor-javascript-module-in-5-2/)
 * In a quick test I have changed ‘wp-editor’ to ‘wp-block-editor’, and the notice
   disappears. (the-events-calendar-shortcode/block/init.php)
 *  Plugin Author [Brian Hogg](https://wordpress.org/support/users/brianhogg/)
 * (@brianhogg)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/#post-15462463)
 * Thanks for the additional detail! We’ll see if we can replicate it and get a 
   fix in an upcoming release.
 *  Plugin Author [Brian Hogg](https://wordpress.org/support/users/brianhogg/)
 * (@brianhogg)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/#post-15498028)
 * Hi [@carret](https://wordpress.org/support/users/carret/) ,
 * Thanks again for reporting the issue and tracking down a potential solution!
 * Just wanted to keep you updated. While switching from `wp-editor` to `wp-block-
   editor` in init.php does resolve the notice, it then breaks the block itself (
   ie. the preview doesn’t generate). We’re still looking into a workaround.
 * Cheers!
 *  Thread Starter [Carret](https://wordpress.org/support/users/carret/)
 * (@carret)
 * [4 years ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/#post-15663199)
 * Hello again.
 * I’ve done some testing and in my case changing ‘wp-editor’ to ‘wp-block-editor’
   seems to work fine. Both posts/pages and widgets show the preview when changing
   options in the block.
 * I don’t know if there’s something I’m missing.
    -  This reply was modified 4 years ago by [Carret](https://wordpress.org/support/users/carret/).
 *  Plugin Author [Brian Hogg](https://wordpress.org/support/users/brianhogg/)
 * (@brianhogg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/#post-15870605)
 * Hi [@carret](https://wordpress.org/support/users/carret/),
 * We were able to identify what seems to be the root cause, and released a fix 
   today (2.5.5). If installing the update doesn’t fix the issue let us know, and
   thanks again for the initial issue report!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘wp_enqueue_script() was called incorrectly. “wp-editor”’ is closed to
new replies.

 * ![](https://ps.w.org/the-events-calendar-shortcode/assets/icon-256x256.gif?rev
   =3023752)
 * [The Events Calendar Shortcode & Block](https://wordpress.org/plugins/the-events-calendar-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar-shortcode/reviews/)

## Tags

 * [notice](https://wordpress.org/support/topic-tag/notice/)
 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * 6 replies
 * 2 participants
 * Last reply from: [Brian Hogg](https://wordpress.org/support/users/brianhogg/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/wp_enqueue_script-was-called-incorrectly-wp-editor/#post-15870605)
 * Status: resolved