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:
- How to access options of Redux framework in front end
- jQuery plugin only in one page/post
- How to fetch serialized data from wordpress options
- Add jQuery to WordPress 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?
- WordPress site migration addvice
- Plugin jQuery version VS Theme jQuery version: search for best practice
- Adding a jquery script to plugin contact form 7
- jQuery function didn’t work in my plugin
- how to include a simple jquery file into a wordpress plugin
- Confused about shortcode and settings values
- Calling JavaScript file with Custom Plugin
- JQuery not working in my plugin [closed]
- Notepad sticky plugin
- Loading jQuery UI in the head
- How can I implement an Add to Collection function on my Image Gallery to be downloaded later?
- Form isn’t inserting data into database with ajax plugin
- custom changes removed after plugin update
- Error with Image Slide plug-in/ s3slider in WP
- Is there a way to set the default active tab on Post UI Tab pluggin?
- Need to change url paramenter of share product pintrest [closed]
- How to tie dark mode with prefers-color-scheme webkit? [closed]
- jQuery for custom plugin not working with Divi theme
- Redux Framework: Page freezes on typing in Editor
- How can I inject options into an select tag inside the widget form?
- How to prevent plugins from loading jQuery
- Loading a purchased jquery plugin in a wordpress theme
- Create shortcode to echo javascript
- how to insert data in wordpress table usnig jquery ajax
- Stop WordPress processing Javascript as text
- Jquery NoConflict Problem
- this jQuery function works perfect in static html page but not on wordpress
- How does one include the JQuery UI plugin to wordpress and enque it correctly in a plugin form?
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- Is there a function to list all uploaded images? How can I add one?
- How to best create a jQuery Slider to display a native wordpress gallery?
- How to remove js ui library added by default by wordpress
- Creating a widget and missing jQuery
- Stop wordpress from requesting external jquery from googleapi
- Api external with wordpress
- why need theme,if page builder is there in wordpress [closed]
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- How do I make sure that my plugin only runs on article detail pages?
- Why do I get jQuery reference error / undefined when changing name of plugin file?
- Custom meta box with jQuery.sortable custom post type list
- How to prevent tabs from opening all at once
- Separate jQuery for Individual Comments?
- force jQuery to load in the head
- FancyBox JS stopped working on multiple sites. Custom plugin responsible. Urgent help needed
- jQuery(‘#news-ticker’).cycle is not a function
- Javascript from Easy-Fancybox place into footer
- WordPress plugin isn’t loading completely
- jQuery slider widget similar to cnet.com
- Problems with jQuery and is_admin()
- FacetWP breaks jQuery events
- How do I reinit WordPress plugins dynamically using jS?
- WP Ajax DB issues
- Get the link title attribute and send it google analytics as custom label via google tag manager using beehive pro for WordPress
- jQuery Ajax not loading page with ACF fields
- Mixed content error after adding SSL certificate
- Website always load twice on start
- main navigation menu disappear after adding jquery source file
- Hide button after form submit and save state to localstorage
- Uncaught TypeError: Cannot read property ‘cycle’ of undefined
- myStickymenu hide on scroll up to certain Y values
- Swap themes locally
- How to solve Blocked a frame with origin from accessing a cross origin frame error in wordpress?
- jquery plugin won’t fire when hamburger class element clicked
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Overwriting Plugin’s Ajax callback function from theme
- Storing Array of values into wordpress options
- Add section (add_settings_section) to a custom page (add_submenu_page) not working
- jQuery to show icon after .hide
- How to add styling and script to a custom widget plugin
- Can’t find variable is_single in my jQuery plugin
- Specific plugin script not working on subdomain
- Not getting result using ajax on wordpress
- Theme Load Error
- How to Add Jquery FullCalendar in wp plugin in admin
- Plugin program: JQuery not working in this plugin
- Ajax, jQuery and WordPress
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- jQuery loaded in wrong order for non-admin page views only
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- PHP and Jquery pass value from form. Update function on DataBase
- WordPress plugin ajax post parameter
- 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
- Load css classes after using ajax calls
- How to resolve these findings from security audit
- Integrating WordPress Content into a jQuery Slider
- Animate like Stack exchange frequently asked questions [closed]
- Change page content based on dropdown selection
- How to add an active state class to my info box