admin管理员组文章数量:1122832
I don't know how but now I am getting this error :
Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in wp-includes/functions.php on line 3049
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in wp-includes/functions.php on line 3049
Warning: Cannot modify header information - headers already sent by (output started at wp-includes/functions.php:3049) in wp-login.php on line 415
Warning: Cannot modify header information - headers already sent by (output started at wp-includes/functions.php:3049) in wp-login.php on line 427
This is what I get when I try to log in... On other sites, I have only two first errors. I try to fix it but I can't. Any suggestions?
I don't know how but now I am getting this error :
Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in wp-includes/functions.php on line 3049
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in wp-includes/functions.php on line 3049
Warning: Cannot modify header information - headers already sent by (output started at wp-includes/functions.php:3049) in wp-login.php on line 415
Warning: Cannot modify header information - headers already sent by (output started at wp-includes/functions.php:3049) in wp-login.php on line 427
This is what I get when I try to log in... On other sites, I have only two first errors. I try to fix it but I can't. Any suggestions?
Share Improve this question edited Apr 26, 2019 at 4:39 Andhi Irawan 1311 silver badge10 bronze badges asked Mar 6, 2014 at 19:54 raidenraiden 3391 gold badge3 silver badges3 bronze badges 2 |7 Answers
Reset to default 19Disable all plugins and switch to the default theme. It should be gone now.
Then enable each addon step by step, until the problem comes back. You know the source now, let’s say a plugin.
The plugin calls probably wp_enqueue_script
too early. Find all occurrences of that function, then make sure they are bound to specific actions:
wp_register_script()
should be called for the actionwp_loaded
wp_enqueue_script
on one of the actionswp_enqueue_scripts
,admin_enqueue_scripts
,customize_controls_enqueue_scripts
orlogin_enqueue_scripts
(see this thread for the latter).
Based on Gregory Schultz's solution:
Wrap all your scripts and styles in a function and hook that function to your target enqueue
action.
本文标签: functionswpenqueuescript was called incorrectly
版权声明:本文标题:functions - wp_enqueue_script was called incorrectly 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736303273a1931828.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
Notice
s seem pretty self explanatory. What have your tried and what didn't it work? – s_ha_dum Commented Mar 6, 2014 at 20:06