There is no need to use the function wp_enqueue_script just to insert jQuery

Hi, i have soft reject.
i don’t understand with this trouble.

reviewers say :
There is no need to use the function wp_enqueue_script just to insert jQuery, since jQuery can be called for those scripts which need it passing the argument array(‘jquery’).

my code :
wp_enqueue_script( ‘THEME-NAME-jquery-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-jquery-1.9.1.min.js’, null, ‘1.9.1’ , false );
wp_enqueue_script( ‘THEME-NAME-owl-carousel-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-owl.carousel.js’, null, ‘2.0.0’ , true );
wp_enqueue_script( ‘THEME-NAME-wow-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-wow.min.js’, null, ‘1.1.2’ , true );
wp_enqueue_script( ‘THEME-NAME-SmoothScroll-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-SmoothScroll.js’, null, ‘1.2.1’ , true );
wp_enqueue_script( ‘THEME-NAME-lightbox-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-lightbox.js’, null, ‘2.8.1’ , true );
wp_enqueue_script( ‘THEME-NAME-fitvids-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-jquery.fitvids.js’, null, ‘1.1.0’ , true );
if( is_rtl() ){
wp_enqueue_script(‘THEME-NAME-rtl-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-THEME-NAME-rtl.js’, null, THEME-NAME_VERSION, true);
}else{
wp_enqueue_script( ‘THEME-NAME-THEME-NAME-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-THEME-NAME.js’, null, ‘1.0.0’ , true );
}
wp_enqueue_script( ‘THEME-NAME-bootstrap-js’, get_stylesheet_directory_uri() . ‘/lib/js/THEME-NAME-bootstrap.min.js’, null, ‘3.3.5’ , true );
if( is_singular() && comments_open() && get_option( ‘thread_comments’ ) ){
wp_enqueue_script( ‘comment-reply’ );
}

how resolve this problem ?

Thanks

Hi,

As per the reviewrs comment.

By default wordpress automatically adds jquery js if you add wp_head() / wp_footer function.

did your theme requires older version jquery / higher version of jquery. then you can add your own jquery.

but remember to explain to the reviewer that you require custom version of jquery for your theme… to run the script :slight_smile:

You are not allowed to load your own jquery library file, you need to use worpdress core jquery

Ok Thanks all for your help, i will try upload again for review. :smile: