Hi @haha:
'admin_init'
is definitely an\ workable way to load scripts but you might also want to take a look at this blog post and consider using the "admin_print_scripts-{$page}"
hook instead which can allow you to only load on your page when you need it and not burden the other admin pages:
Here’s code from the blog post, albeit modified a bit:
$your_page = add_management_page('myplugin','myplugin',9,__FILE__,
'yourplugin_admin_page');
add_action("admin_print_scripts-{$your_page}",'yourplugin_jquery_tabs_loader');
function yourplugin_jquery_tabs_loader() {
// what your plugin needs in its <head>
}
Related Posts:
- Pass PHP variable to javascript
- force enqueue script to be first in order of prominence
- WordPress 3.5 Media Manager – add a button
- How can I make default jquery version of WordPress “async”?
- Help making my pagination plugin better
- Handling jQuery Component Collision
- How to Add jQuery Infinite Scroll to My Custom Archive Page
- How to access options of Redux framework in front end
- jQuery plugin only in one page/post
- Is dynamic forms/entries possible in Widget?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Editor not displaying dynamically after clicking on the button
- jQuery AJAX call not executing in Plugin
- WordPress Enqueue Script Chaos (jQuery & Foundation.js)
- How to fetch serialized data from wordpress options
- Check javascript file Proper way in functions.php
- How to load plugin before the wordpress jquery?
- WordPress Plugin development Call to undefined function jQuery()
- Add jQuery to WordPress page
- Why is my ajax call refreshing the page?
- How do I use WordPress PHP functions in my Javascript code?
- Disable wordpress from including jQuery in the head section
- What’s the point of using WordPress’s built in admin-ajax.php?
- Admin-ajax.php is dying “0” without processing function
- Add a Custom Permalink option in the Permalink Admin Screen?
- Get image URL from media library in input
- How to create popup same as wordpress popup feature
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- WordPress site migration addvice
- Ajax with jQuery UI dialog not working
- Plugin jQuery version VS Theme jQuery version: search for best practice
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- Adding a jquery script to plugin contact form 7
- jQuery function didn’t work in my plugin
- Add section (add_settings_section) to a custom page (add_submenu_page) not working
- Help with customising love it plugin (use within foreach)
- jQuery to show icon after .hide
- How to add styling and script to a custom widget plugin
- ‘Easy Template Path Hints’ for WordPress?
- Can’t find variable is_single in my jQuery plugin
- show-hide based on select option jquery wordpress
- How to install jquery dotdotdot plugin for WordPress?
- Specific plugin script not working on subdomain
- Add HTML between feed items
- Javascript in plugin not working
- WordPress Feedback popup with date saved into table
- Not getting result using ajax on wordpress
- Theme Load Error
- How to Add Jquery FullCalendar in wp plugin in admin
- Creating a comments voting system
- WordPress ajax not working in registration
- Plugin program: JQuery not working in this plugin
- Calling an custom field from theme option at the frontend
- AJAX doesn’t pass variables to the php function in the plugin
- How to add jquery to my custom post type wp plugin
- What is the process for reimplementing a back up WordPress?
- Like/Dislike Bar not working when updating
- jquery-issue: cannot load the basic jquery
- Possible jquery / library conflict in plugin usage
- Ajax, jQuery and WordPress
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- Add jQuery in dashboard when is already added in main plugin page
- jQuery loaded in wrong order for non-admin page views only
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Why won’t the Comprehensive Google Map Plugin load?
- PHP and Jquery pass value from form. Update function on DataBase
- WordPress plugin ajax post parameter
- get_option include in my adsense
- WordPress Options-Theme STD (default) value does not work
- how to call jQuery in admin as well as in homepage
- “The Events Calendar” Issues in WP 3.2
- Plugin use of ajax/jquery depending dropdown
- How do I output user_registered time in my correct timezone?
- Ajax in Plugins: returns the whole page
- Site is setup statically – how to make it content managable?
- Element works, but not on wordpress site [duplicate]
- Shortcode return is printing a 1 afterward
- Load css classes after using ajax calls
- WordPress site keeps getting flagged as malware [closed]
- FacetWP: Plugin breaks button/modal functionality inside searchable content area
- How to resolve these findings from security audit
- TypeErrors with Yoast, jQuery in conflict?
- Javascript as Jquery Function Call?
- Integrating WordPress Content into a jQuery Slider
- JQuery UI plugin not working in IE7?
- Animate like Stack exchange frequently asked questions [closed]
- Jquery based image accordian plugin
- wordpress jquery is not defined because the head tag is empty
- Count div with class (.length) only shows 0 [closed]
- Jquery post responses 500 error after some time and lastly an 503 error
- Change page content based on dropdown selection
- Ajax button “Load more” is not loading correct language version posts for logged out users
- WordPress GiveWP Plugin showing blank page in none default theme [closed]
- How to add an active state class to my info box
- Woocommerce attatch files and custom input meta to cart items and then to order
- Ajax response from Media Selection does not update ALL information more than once
- Custom plugin translation not working
- How to ajaxify all pages of my Wp Site
- implement pop up in wordpress cdn’s in wordpress admin side