If you really want to do this, then it should already be possible.
The global $wp_scripts
is an instance of the WP_Scripts
class, which is an instance of the WP_Dependencies
class.
So in theory (not tested), you should be able to do something like this:
function alter_script_tags()
{
echo '<pre>';
print $GLOBALS['wp_scripts']->print_html;
echo '</pre>';
}
add_action( 'wp_enqueue_scripts', 'alter_script_tags', 999999 );
This is just a rough sketch, but you should get the idea.
Related Posts:
- Search and Replace Script Loader in Head Only Works in Footer
- remove empty paragraphs from the_content?
- Issues with title-tag and document_title_parts
- Remove Actions/Filters added via Anonymous Functions
- Set JPEG compression for specific custom image sizes
- Define custom Page Template without its own .php file
- Add class to menu items of one specific menu (nav_menu_css_class)
- How to influence the information displayed on widget inside wp-admin
- Where and how to put inline js in pages
- Removing default image size list in Media Box
- Does WordPress Development Mode Exist (with not minified JS)?
- How to restrict actions and filters “properly” by conditions
- Filter the query ONLY for the search results page
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Using add_filter() in Widgets
- Customize WordPress Media Manager – Media Window
- Apply jquery script to only woocommerce product pages and categories
- How to reduce original image quality on upload?
- Is it possible to use a forgot password url filter?
- syntax for remove_filter in parent theme with class
- Add body class of category parent
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Convert hyphen to underscore in permalinks
- Override parent theme function that is not hooked or in the functions.php file
- Remove Page Title from Static Frontpage
- Programmatically Add Font-Awesome Icons to Category Widget
- Remove bulk actions based on user role or capabilities
- Default or Preset Content for Custom Post Types
- Override a class function to include a custom template
- How to override filter in child theme?
- Removing title from page
- Hide some items from Screen options in dashboard for products
- How to change a certain text or term of WordPress into a custom into the whole site?
- Run Product Filter Javascript On Page Template
- Enqueuing External Javascript functions.php
- How to enqueue JavaScript for specific WordPress pages only?
- Adding body class when post contains a specific shortcode
- Defer all js except certain ones in functions.php file
- Enqueuing Script in functions.php vs on the page
- Replace Archive Widget Link Text
- Exclude Empty Child Categories in Menu
- Properly applying nonce to a form using AJAX
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Best way to programatically add “rel” attributes to page and post images
- add_filter priority problem
- Limit filter upgrader_post_install to a single plugin
- How to update feed only 2-3 times a week (for Feedburner email)?
- Manipulate Output of wp_list_something: select menu instead of li’s
- Search user metadata with checkboxes via ajax (almost working)
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- How to use IF Statement in WordPress?
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- Why is my Gutenberg block returning an error after initial save?
- Shortcode to eliminate and replace with
- Automatic add space if user enters number(any digit)
- previous_post_link inside of a function?
- Regex works in regexr, but not if I filter content [closed]
- Retrieve a custom form field modified by a filter
- functions.php filters not applied in AJAX call
- custom post with loading script per single post
- Problem in outputting shortcode
- Why are some custom javascript files working but some are not
- Settings in functions.php used by a plugin
- WordPress Javascript Widget jQuery Dependency Issue
- How to Add A Rel Filter to All Links?
- Print all inline styles to head
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- Allow tags and attributes in post and pages content
- Override parent theme function that is not hooked or in the functions.php file
- child_of not working while searching
- Can’t change excerpt length and more tag
- Function Reference for custom link in Admin Menu Management Page
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- How do I get my nav menu to show sub pages?
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- Why wp_ajax hooks doesn’t work?
- new to javascript – using in instead of functions.php, not loading correctly
- Filter to strip unnecessary attributes
- Trying to get this function to show below the content
- comment_post function with js not running
- Animated Accordion [closed]
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Can’t find function which is called in a wordpress theme
- function to show youtube videos within excerpt – if condition and apply_filters
- dynamically import array from another js file in WordPress
- How can I modify or filter this variable in an existing class? (Mai Theme)
- WordPress enque the same script causes the setInterval not to work
- iOS and ajaxComplete
- How to use webpack in WordPress theme? I want some scripts to load in the footer, some in the header and some with script parameters
- get last part of page url and add it as cat in wp_query
- Apply function only for specific post
- Second featured image only shows in metabox preview after saving a post in the wordpress editor
- Overriding an existing filter
- disable a specefic sidebar when user is log out
- Help with adding fullcalendar.io to a WordPress page
- Remove Actions/Filters added via Anonymous Functions
- Function to filter numbers from string