• Hi Guys,

    Off and on poster here so forgive me if I got this question in the wrong forum. Anyways, when going through my client’s debug log I came across the following error message:

    [25-Nov-2022 22:25:05 UTC] PHP Notice: Function wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks.

    With it mentioning a line reference at:

    /public_html/wp-includes/functions.php on line 5835

    I was wondering if anyone can give me an idea of what this warning means?

    Thanks,

Viewing 1 replies (of 1 total)
  • Moderator James Huff

    (@macmanx)

    That line processes all functions, not just core, but plugins and themes as well.

    Please attempt to deactivate all plugins and switch to the default Twenty Twenty-One theme. If the problem goes away, re-activate them one by one to identify the source of the problem.

    If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to deactivate all plugins and change the theme for you while you’re still logged in without affecting normal visitors to your site.

Viewing 1 replies (of 1 total)

The topic ‘wp_enqueue_script Error’ is closed to new replies.