Support » Plugin: Theme Check » WARNING: Found wp_deregister_script in functions.php.

  • WARNING: Found wp_deregister_script in functions.php. Themes must not deregister core scripts.
    Line 245: wp_deregister_script('jquery');

    This is one of the best plugin for WordPress developers. But this WARNING confuses me.

    In that line there is:

    if(!is_admin()) {
            wp_deregister_script('jquery');
            wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '1.9', true);
            wp_enqueue_script('jquery');
        }

    If I remove that deregister line, jQuery won’t load and the theme is pretty much dead.
    Any answer how I could get rid off this warning would be appreciated!

    Thank you.

Viewing 1 replies (of 1 total)
  • Ulrich

    (@grapplerulrich)

    You can just use wp_enqueue_script('jquery'); as jquery is included in WP core or define jquery as a dependency for your scripts.

    A support ticket would be better than a review.

Viewing 1 replies (of 1 total)
  • The topic ‘WARNING: Found wp_deregister_script in functions.php.’ is closed to new replies.