6 posts
  • Has been a member for 1-2 years
anomy says
It’s a very poor practice to deregister WordPress’ built-in jQuery and load another specific version. Please use the WordPress default javascript library.

Is this reviewer saying I cannot use an up-to-date jQuery version? I must use 1.7.2 or whatever version WP rolls?

So how does one exactly load jQuery 1.9.1 into a WP theme?

Here is what I’m currently doing:
function my_jquery_enqueue() {
   wp_deregister_script('jquery');
   wp_register_script('jquery', get_template_directory_uri() . '/assets/js/jquery.1.9.1.min.js', false, '1.0', 'all' );
   wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'my_jquery_enqueue');

My code relies on the recent jQuery to work…

420 posts Dream big
  • Elite Author
  • Sold between 50 000 and 100 000 dollars
  • Has been a member for 1-2 years
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
  • Croatia
  • Exclusive Author
pixel-industry says

It’ really bad practice to deregister Wordpress jQuery. As I can see WP 3.5 has jQuery 1.8.3. Check if that version have methods you need.

by
by
by
by
by
by