There’s a filter: script_loader_tag
.
add_filter( 'script_loader_tag', 'wpse397773_change_script_tags', 10, 3 );
function wpse397773_change_script_tags( $tag, $handle, $src ) {
$tag = '<script type="text/plain" src="' . $src . '" id="' . $handle . '-js"></script>';
return $tag;
}
This should change all the <script>
tags in the page (assuming they’re properly enqueued) to <script type="text/plain">
.
Update: To only change the <script>
tag for the juicerembed
script, you can do this:
add_filter( 'script_loader_tag', 'wpse397773_change_script_tags', 10, 3 );
function wpse397773_change_script_tags( $tag, $handle, $src ) {
if ( 'juicerembed' == $handle ) {
$tag = '<script type="text/plain" src="' . $src . '" id="' . $handle . '-js"></script>';
}
return $tag;
}
I haven’t tested this at all, but hopefully it’ll be a starting point for you.
Related Posts:
- force enqueue script to be first in order of prominence
- Dequeue / Deregister script and replace it with a new plugin
- Add extra parameter in tag using script_loader_tag
- How to avoid redefining requirejs in plugin when another plugin also uses requirejs
- Problem in loading javascript in footer
- React JSX in WordPress Plugin Development
- Enqueue WordPress plugin scripts below all other JS
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Is there a loading priority for login_enqueue_scripts?
- Deactivate JS Script in Plugin Shortcode
- Remove / overwrite some functions in buddypress.js
- How to enqueue some javascript source once per page
- Why can I not deregister my style and script on custom post type?
- Adding Additional Attributes in Script Tag for 3rd party JS
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- A better way to override plugin’s JS files?
- How can I reduce the amount of files loaded/included per plugin?
- Why my browser keeps loading old version of custom JavaScript files in \divi\js? [closed]
- Which method is best to enqueue scripts
- Get info (url) from already enqueued styles
- Pass $this to function nested in another public function of the same class
- How to use wp-ajax in wp-cron
- dequeue not work
- Insert code after tag without using functions.php?
- Adding Scripts in the Admin Area
- Overriding a function in wordpress
- Adding with javascript to admin bar. Works in Chrome/Safari, not Firefox
- Passing select control value to block
- Reuse javascripts from plugins within the theme
- Localiztion in javascript
- WP-Cufon adding extra space in my paragraphs in Firefox and Chrome
- Register script in one plugin, and enqueue it in another
- add mediaelement.js plugins into WordPress video player control bar
- How to remove style and js from theme and add your own style and js where shortcode is used?
- Best approach to fetch data from wp options to js file or php file
- wordpress site | All-in-one-cufon IE Issue
- How to add Internationalization in WordPress using Javascript/React?
- How to get the element ID from new menu list that added with add_filter()?
- Override Plugin Script Fucnction in WordPress
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- Is there a standard way to listen for an on change event of a posts featured image
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- How to insert HTML/JavaScript form into WordPress page? [closed]
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- Using window.onload with Ubermenu
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- how to prevent all css and javascripts files from loading
- wordpress add_action() issue in ajax call
- Localizing methods for jQuery append prepend wrap parent
- Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Enqueue script: link not working in page source
- Conditional custom redirect
- Load CSS files in header of Bones theme?
- how to request a script more than once in wordpress
- How to turn off automatic operation for Nivo Slider?
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- Wp-minify doesn’t seem to minify my JS code
- Edit all $wp_scripts at once to $in_footer = false
- Ajax call not working in wordpress through a plugin
- Javascript fetch on wordpress plugins not working
- Jquery POST Ajax Return null data in wordpress
- Stop a script on a single page
- wordpress plugin add page when activate
- Validating ajax search
- Cannot run script properly with my custom plugin
- Overriding inline !important CSS with Javscript code snippet with media query
- Add style to body based on url
- Performing CRUD operations on front end in wordpress
- How to add specific script to WordPress webpage that will working with user input and databases
- Ajax Call not Working in Plugin
- How to create a custom block in Gutenberg with multiple checkboxes?
- Enqueue plugin for specific pages
- Add external javascript to post template
- AJAX update fails for public/non-admin users
- plugins_url not returning correct directory
- Javascript inserted from Plugin pointing to wrong location
- How do I keep children of certain parent menus expanded by default on a sidebar?
- Conditional Fields depending on checkboxes
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How to pass value from WordPress to Javascript
- Facebook Quote Plugin for Blockquote?
- Adding javascript to header of MetroMagazine theme
- How to install jquery dotdotdot plugin for WordPress?
- Javascript in plugin not working
- Jetpack Comments Change Placeholder Text
- Media Playlist Plugin
- Adding an onchange event to a custom dropdown menu in WordPress
- Possible jquery / library conflict in plugin usage
- Plugin and javascript placement
- WordPress include scripts and style in plugin page
- Why won’t the Comprehensive Google Map Plugin load?
- get_option include in my adsense
- Expanding / Collapsing Modules in WordPress Panel
- Move specific javascript to the footer
- making a simple plugin
- Javascript as Jquery Function Call?
- how to show selected options drop down menu values in attributes field in after saving post.php
- Vanilla javascript in custom gutenberg block not working