syntaxhighlighter
syntaxhighlighter copied to clipboard
PHP Notice: wp_enqueue_script() was called <strong>incorrectly</strong>.
Steps to Reproduce
- Enable WordPress Debug
- Activate a Non-FSE theme
- Go to Apperiance > Widgets
- Add a new SyntaxHighlighter Evolved widget
- Check debug Log
What I Expected
- No errors or notices in the debug log
What Happened Instead
- Got the following PHP notice message
PHP Notice: wp_enqueue_script() was called <strong>incorrectly</strong>. "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.8.0.) in /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-includes/functions.php on line 5768
[25-Mar-2022 08:41:12 UTC] PHP Stack trace:
[25-Mar-2022 08:41:12 UTC] PHP 1. {main}() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-admin/widgets.php:0
[25-Mar-2022 08:41:12 UTC] PHP 2. require() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-admin/widgets.php:32
[25-Mar-2022 08:41:12 UTC] PHP 3. require_once() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-admin/widgets-form-blocks.php:69
[25-Mar-2022 08:41:12 UTC] PHP 4. do_action() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-admin/admin-header.php:163
[25-Mar-2022 08:41:12 UTC] PHP 5. WP_Hook->do_action() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-includes/plugin.php:474
[25-Mar-2022 08:41:12 UTC] PHP 6. WP_Hook->apply_filters() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-includes/class-wp-hook.php:331
[25-Mar-2022 08:41:12 UTC] PHP 7. wp_check_widget_editor_deps() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-includes/class-wp-hook.php:307
[25-Mar-2022 08:41:12 UTC] PHP 8. _doing_it_wrong() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-includes/widgets.php:2090
[25-Mar-2022 08:41:12 UTC] PHP 9. trigger_error() /Users/rav/Local Sites/bp-syntaxhighlighter-evolved/app/public/wp-includes/functions.php:5768
PHP / WordPress / SyntaxHighlighter Evolved version
- PHP 7.4.1
- WordPress 5.9.2
- Theme: Twenty Twenty v1.9
- SyntaxHighlighter Evolved 3.6.1
Browser / OS version
- N/A
Context / Source
- https://wordpress.org/support/topic/notice-wp_enqueue_script-in-wordpess-5-8/#post-15492793
We have the same problem with our older themes, getting the same notice.