Title: Widget issue: Notice: Function wp_enqueue_script() was called incorrectly.
Last modified: January 23, 2025

---

# Widget issue: Notice: Function wp_enqueue_script() was called incorrectly.

 *  [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-issue-notice-function-wp_enqueue_script-was-called-incorrectly/)
 * Hi there,
    I noticed I get the warning `Notice: Function 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 wp-includes/functions.php on line 6114` when using table of contents.
 * I tracked down the error, which is due to EditorBlock class in plugins/EditorBlock.
   If I get it correctly, you try to hook both pre-5.8 and post-5.8 WordPress widgets.

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

 *  Plugin Author [LuckyWP](https://wordpress.org/support/users/theluckywp/)
 * (@theluckywp)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-issue-notice-function-wp_enqueue_script-was-called-incorrectly/#post-18277135)
 * Hello!
   What page do this appears?What version WP do you use?
 *  Thread Starter [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-issue-notice-function-wp_enqueue_script-was-called-incorrectly/#post-18277166)
 * latest version of everything. I could reproduce on a blank WordPress flavour.
   I’m using “OceanWP” theme, but I tried with also “Highlights news” theme. I guess
   any widget based theme would return same notice.
 * To reproduce it, just activate one of those two themes, activate ToC and WP debugging.
   Then go to widgets administration.

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

The topic ‘Widget issue: Notice: Function wp_enqueue_script() was called incorrectly.’
is closed to new replies.

 * ![](https://ps.w.org/luckywp-table-of-contents/assets/icon-256x256.png?rev=2100677)
 * [LuckyWP Table of Contents](https://wordpress.org/plugins/luckywp-table-of-contents/)
 * [Support Threads](https://wordpress.org/support/plugin/luckywp-table-of-contents/)
 * [Active Topics](https://wordpress.org/support/plugin/luckywp-table-of-contents/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/luckywp-table-of-contents/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/luckywp-table-of-contents/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [JCV](https://wordpress.org/support/users/psykonevro/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/widget-issue-notice-function-wp_enqueue_script-was-called-incorrectly/#post-18277166)
 * Status: not resolved