How Do You Load jQuery UI Plugin Only In My WP Plugins Menu Page?
-
I’ve tried a bunch of things to get it to load, this seemed to make the most sense, but it doesn’t load the file either. I’m down to dropping the wp_enqueue throughout my plugin trying to see if that loads the files. Don’t ever see it in the resources but the wp_enqueue call works in the theme so I know that I’m loading jQuery ui and accordion correctly. Any idea why or how to do this? Seems to be a lot of answers out there but none have worked.
add_action('admin_menu', 'myplugin_add_menu_page'); function myplugin_add_menu_page() { // Add plugin submenu page $subpage = add_submenu_page('parent_slug' ,'Page Title' ,'Menu Title' ,'manage_options' ,'my_plugin' ,'my_plugin_render_form' ); add_action( "admin_print_scripts-$subpage", 'myplugin' ); } function myplugin() { // NOTE: it makes it here but this doesn't load the plugins wp_enqueue_script( 'jquery-ui-core' ); wp_enqueue_script( 'jquery-ui-accordion' ); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How Do You Load jQuery UI Plugin Only In My WP Plugins Menu Page?’ is closed to new replies.