wp_enqueue_script()
utilizes the WP_Scripts
class, which extends the WP_Dependencies
class. If you checkout that class, you will see a bunch of arrays at the top. So you could actually loop through list of queued scripts like so:
global $wp_scripts; // If inside a function
foreach($wp_scripts->queue as $script) {
// Do some tomfoolery here... ;)
}
Also, if you use wp_enqueue_script()
, it won’t load the script more than one time. It actually checks to see if it’s been enqueued, so I think the above is moot anyway. Good to know either way.
References:
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/functions.wp-scripts.php
http://core.trac.wordpress.org/browser/trunk/wp-includes/class.wp-dependencies.php
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Related Posts:
- Enqueue script globally
- Objective Best Practices for Plugin Development? [closed]
- ajaxurl not defined on front end
- How to add a javascript snippet to the footer that requires jQuery
- How do i best handle custom plugin page actions?
- How to create an API for my plugin?
- Is it ever okay to include inline CSS in plugins?
- Plugins in symlinked directories?
- How to enqueue JavaScripts in a plugin
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- How to include jQuery and JavaScript files correctly?
- Best way to abort plugin in case of insufficient PHP version?
- How can I configure Docker for developing and deploying a custom theme?
- What do you think about custom designed plugin/theme options UIs?
- No Error Log File, no debug info
- Where to put third party PHP library?
- Is the new WordPress 3.1 admin bar pluggable and how can I extend it?
- How to use PanelColorSettings in custom Gutenberg block?
- How to modify files inside wp-includes directory in wordpress
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Custom entity search and display
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- WP Plugin Running before jQuery
- wp_localize_script is not adding a global variable for javascript
- Plugin: database creation
- should i be checking for jquery before enqueing it in a plugin
- How to import the css in the plugin admin area?
- Show message from backend
- My stylesheets are not enqueuing
- Plugin Development – Class Constructor Not Firing wp_enqueue_style action hook
- Custom Plugin – CSS works, JS doesn’t
- Enqueuing scripts and styles in custom plugins
- Why in this archive page that call query_posts() function show only the last 10 posts?
- How to enqueue scripts in right way in a plugin?
- Create Widget or Enable Shortcodes in Sidebar
- unable to wp_enqueue_script(‘suggest’);
- How to make my shortcode load scripts and styles, from within the plugin?
- Logout after clicking URL link results in “headers already sent” error
- How do I get rid of my inclusion race-condition on wp_enqueue_script
- Using function from enqueued .js file in theme in plugin?
- how to save wp_editor html content in options table
- Enqueue a file that’s not js or css
- Enqueueing common php scripts in a plugin
- Converting core modification to a plugin
- How to use a WP_Customize_Control outside of the Customizer?
- How to replace settings in WordPress plugin from a theme
- How to remove/replace current page template?
- Enqueue scripts inside a class in a plugin
- Enqueue ONLY Plugin Styles and Scripts
- wp_enqueue_scripts in a plugin’s class
- WordPress Plugin Authoring question about jquery and css
- Loading Images from Javascript on the Front End
- Setting a post’s category
- Extract Information from post content (using regex?)
- How to determine which capability to use?
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- Customise Grouped Product display in Woocommerce with custom column
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Why won’t this submenu page show? – My First WordPress Plugin
- How to create a custom post-new.php page for plugin , no wp menu
- Add default value from selection
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Is “document loaded” different on admin side than public side?
- Save meta box data from selected dropdown list in bbpress reply form
- Metabox types list
- plugin css is not being applied to the page
- Where to save Gutenberg plugin data?
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Adding External Gmap JS to WordPress
- Rate limiting ajax requests in WordPress
- How do I ensure I can loop through every enqueued script and CSS?
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Append php file to footer
- How to avoid conflict if a plugin already have included open library?
- AJAX call of function containing javascript which is not loaded (Plugin development)
- How to prevent users from deleting their accounts?
- Hiding class namespace from plugin’s extensions
- Javascript not being loaded only in custom taxonomy template
- Set widget icon in Customizer?
- Ajax Response Error | just getting error as the response
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- Create Customization panel for Plugins not for theme
- Enqueue scripts based on site.
- Determine if the current page, is being edited
- WordPress delete mysql rows with string
- external Integration with wordpress timeout error
- Add function to Dokan ajax class
- PHP includes with AJAX actions
- How to enqueue an external Javascript file to Frontpage footer
- Making adding info to an overlay bio easy for average user?
- Implementing Select2 plugin into WordPress
- Custom Post Type and Functions
- Associating special meaning with user id 0
- Enqueue script not working
- Managing Custom Designed Content
- Can I access WordPress API’s from within plugin scripts?
- Theming Custom Plugin Page
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- Script work on non logged in user but not work for logged in user?