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:
- 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
- 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
- How to prevent plugins from loading jQuery
- Using window.onload with Ubermenu
- jQuery | JJ Carousel Plugin – Can’t set speed [closed]
- Jquery plugin not working on single pages
- Jquery NoConflict Problem
- this jQuery function works perfect in static html page but not on wordpress
- How to include this jQuery File in wordpress?
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- “Conflict” with jQuery (or its plugins)?
- Elementor: How to override global theme style settings? [closed]
- a weird attribute on every html tag
- How to add an element right after the article using jQuery?
- How to track clicks
- Remove Yoast jQuery from front end
- How to display checked posts on another page over AJAX? (like comparasion style)
- Adding media upload button to User Profile page (following a tutorial)
- I changed .live() to .on() but change is not reflected on the server
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- Save user total active time after login in wordpress [closed]
- Opening a JQuery modal window on click of a button with a JQuery plugin
- Why does my jQuery plugin show up as text in WordPress?
- How to customize this theme? [closed]
- How do I make sure that my plugin only runs on article detail pages?
- Disable submit button order
- Enqueue script: link not working in page source
- Why jquery option is not working when pass value using wp_localize_script?
- jQuery code didn’t run on my plugin
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- “switchEditors is not defined” with wp_editor() in jQuery UI tabs
- force jQuery to load in the head
- Ajax request sends url rather than data
- Error jQuery(domChunk).live is not a function
- sliding/fading header plugin or approach suggestion
- Pass PHP variable to javascript
- Cannot read properties of undefined (reading ‘firstChild’) using photoswipe in product page
- Trigger jQuery to add events after AJAX-loading table in admin plugin
- wc_get_template_part doesnt display the content [duplicate]
- How do I reinit WordPress plugins dynamically using jS?
- login form should redirect to register page for in 1st login next time it should redirected to home page
- Cannot pass value variable to WP AJAX functions
- How to properly enqueue jQuery knob on WordPress without conflict?
- How to get a specific string from a url
- Does anybody know how to insert a complete jquery plugin into a wordpress elementor-page?
- JS working when used normally but not in wordpress
- $wpdb not working wordpress plugin ajax call
- main navigation menu disappear after adding jquery source file
- Scroll to ID broken in main menu
- WordPress Thickbox Navigation Issue in Gallery
- Dynamic input fields in WordPress Plugin
- Overwrite js code using WP_Footer
- Not displaying Woocommerce product page in lightbox
- What’s a good way to default behavior if a plugin is inactive?
- Storing Array of values into wordpress options
- How to add styling and script to a custom widget plugin
- ‘Easy Template Path Hints’ for WordPress?
- show-hide based on select option jquery wordpress
- Add HTML between feed items
- WordPress Feedback popup with date saved into table
- WordPress ajax not working in registration
- Calling an custom field from theme option at the frontend
- AJAX doesn’t pass variables to the php function in the plugin
- 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
- Element works, but not on wordpress site [duplicate]
- Shortcode return is printing a 1 afterward
- WordPress site keeps getting flagged as malware [closed]
- FacetWP: Plugin breaks button/modal functionality inside searchable content area
- TypeErrors with Yoast, jQuery in conflict?
- Count div with class (.length) only shows 0 [closed]
- Jquery post responses 500 error after some time and lastly an 503 error
- 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]
- 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