I develop a plugin and I want use jquery-ui-datepicker. And now I have huge problem. If I use construction like this:
function FQ_init_method() {
wp_enqueue_script( 'Free_Quotationadmin1-script', plugins_url('js/jquery-2.0.2.min.js', __FILE__) );
wp_enqueue_script( 'Free_Quotationadmin2-script', plugins_url('js/jquery-ui-1.10.3.custom.min.js', __FILE__) );
wp_register_style( 'Free_Quotationadmin-style', plugins_url('css/menu.css', __FILE__) );
wp_register_style( 'Free_Quotation-style', plugins_url('css/style.css', __FILE__) );
wp_register_style( 'Free_Quotationadmin2-style', plugins_url('css/jquery-ui-1.10.3.custom.min.css', __FILE__) );
}
add_action('admin_init', 'FQ_init_method');
FireBug detect the jQuery and everything work. But admins on WordPress repository doesn't want accept my plugin if I use my own jQuery. They oblige me to use incorporated to WP version of jQuery. But if I use this code:
function FQ_init_method() {
wp_enqueue_script( 'jquery');
wp_enqueue_script( 'jquery-ui-core');
wp_enqueue_script( 'jquery-ui-datepicker');
wp_register_style( 'Free_Quotationadmin-style', plugins_url('css/menu.css', __FILE__) );
wp_register_style( 'Free_Quotation-style', plugins_url('css/style.css', __FILE__) );
}
add_action('admin_init', 'FQ_init_method');
FireBug doesn't detect any jQuery from my plugin... Why??? I don't have any idea...
--------EDIT--------------------------------
Sorry - this is not a problem. Now everything is OK but in FireBug i doesn't see information that I use jQuery. My mistake was in different place - ID of data was different than should be, and own script (2.0.2) accept it. Now I correct it and everything work OK.
WordPress uses jQuery no conflict, so it sits under the jQuery() namespace rather than the $() namespace. Could this be your issue?