I know the question have been asked many times, but none of them doesn't actually meet me. So without saying bla bla, I'm saying my situation first:
In my plugin, I need to add a custom post type, then to load custom meta box, and to sort the meta box in good way I need to add them using jquery tab.
From these, I could implement the first two:
- Making CPT
- Adding Meta box and could save meta data
But I'm unable to load the jquery thing for the tabs.
As I know I can utilize the default jquery
and jquery-ui-tabs
and enqueue them in admin end. But when I'm using:
function load_scripts() {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-ui-tabs' );
}
add_action('admin_enqueue_scripts', 'load_scripts');
The tabs are not working. But if I load my custom jquery and ui scripts from my plugin, the tabs are working...but,
but, the tab is working only on the "Add new PostType" page (post-new.php
), but NOT WORKING on PostType Edit Page (post.php
).
So here comes the million dollar question:
* How can i load scripts in wp admin from plugin - the right way?