Are you able to post the full error message including the filename and line number? That would really help!
Thread Starter
guaser
(@guaser)
hey there, I get this message (trunkated in order to hide my folders / files):
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.0.) in /home/…/public_html/wp-includes/functions.php on line 4139
Cheers!
Thread Starter
guaser
(@guaser)
And… You fixed it 🙂
Seems you’ve managed to fix the issue in a newer update. Awesome 🙂
Thank you very much!
Jon
(@freshyjon)
I’m having the same problem. I didn’t change anything within the Snippet, but now if I just “Save” the Snippet I get an error.
The code snippet you are trying to save produced a fatal error on line 88:
Cannot redeclare fs_wc_csv_export_add_roles_to_customer_export() (previously declared in /nas/content/live/scorpionbuild/wp-content/plugins/code-snippets/php/snippet-ops.php(427) : eval()’d code:75)
Jon
(@freshyjon)
Nevermind. I see the LATEST update did indeed fix that.
@guaser: the latest update may have hidden the message, but the problem still exists. I believe that in one of your snippets you may be calling wp_enqueue_script() outside of a function hooked to the appropriate hook. It’s probably a good idea to go through your snippets and find the one that could be causing this error.
@freshyjon: This was definitely a bug in the recent version, but it should have been patched in version 2.9.3. Thanks for reporting the error!
Thread Starter
guaser
(@guaser)
Hey Shea Bunge,
Thanks a lot for your updates. I’ll take a look into it.