You could use the script_loader_tag
filter hook to accomplish this. This hook passes in the tag HTML that you can search on, then add in your data attribute.
/**
* Modify script tags as they're loaded
*
* @param String $tag_html
*
* @return String $tag_html
*/
function wpse379555_script_tag( $tag_html ) {
if( false === strpos( $tag_html, 'wpfastestcache' ) ) {
return $tag_html;
}
return str_replace( ' src="https://wordpress.stackexchange.com/questions/379555/," data-wpfc-render="false" src=", $tag_html );
}
add_filter( "script_loader_tag"https://wordpress.stackexchange.com/questions/379555/,"wpse379555_script_tag' );
Related Posts:
- Woocommerce – adding variations to variations [closed]
- Passing a parameter to filter and action functions
- Do deactivated plugins slow down a WordPress site?
- Allow all file types for upload
- Difference between a theme and a plugin?
- Update plugin from personal API
- Creating Unique Post URLs for A/B Testing… Is this even possible?
- Change Label for field used in Woo Commerce
- Symlinked plugin directory doesn’t appear in Admin
- Suggest a plugin for up/down voting posts [closed]
- How to disable Gutenberg editor?
- How to install plugins in individual sites on a wordpress network?
- Get Latest Plugin Version from WP API
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- Cron Job not working in plugin
- How to get all attachment image from post ?? WordPress
- How to check if I am displaying categories on a Woocommerce page? [closed]
- What plugin should I use for a basic user signup/login system [closed]
- Stop the form of beign submitted on “Save changes” custom option page
- How to avoid redefining requirejs in plugin when another plugin also uses requirejs
- Review plugin with rating of post [closed]
- Can I use the same textdomain in two separate plugins?
- Hook to generate a dynamic sitemap with “All in One SEO Pack” Plugin
- Displaying a Welcome Message to a Woocommerce User
- How use %like% in sql statement wordpress
- Can I use a form in a dashboard widget?
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- WordPress Social Login > Post to a users Facebook wall
- Why slash is removed after domain?
- add mediaelement.js plugins into WordPress video player control bar
- MITM risk of not sanitizing?
- WordPress Central User Database
- Why Won’t Exported Blog From One Site Import Into New Site?
- Any built-in function to associate a post to category through a plugin?
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Filtering WooCommerce Orders by Category
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Suggestions on Approach to New Plugin I’m Stuck On
- How to redirect users to their profile after they successfully edit their profile
- Disable Gravatars in WordPress
- Getting a “Warning: call_user_func_array()” error whenever I install/update a plugin
- Integrating jQuery Datatables with Editor into wordpress admin
- Preventing My Plugin From Being Used For Free
- Remove_action from plugin with a Class
- Shortcode not getting replaced
- How do I override plugin templates and stylesheets?
- Plugin that will output submitted form data for user? [closed]
- WordPress plugin to auto execute php script on a specific time?
- How to import WordPress site to new WordPress site?
- Why does this code snippet create a critical error on my site? [closed]
- How to manipulate the content within wp_head
- Admin page button create new
- Restore with Duplicator, URL is concatenated twice
- Installing plug ins on a wordpress hosted site
- How do I link an image in my plugin so it displays on WordPress?
- Using conditional staements to load plugins
- WordPress “Add new tag” button is not working
- Cannot access empty property error in Advanced Access Manager
- How to get the get the select values created by ACF plugin in wordpress
- Calendar for irregular recurring events [closed]
- jQuery gallery plugin to interface with Picasa
- Looking for a photo gallery plugin [closed]
- Get Page URI for QR Code PHP [closed]
- How do I allow users to supply a photo/image to be used instead of the grey/white silhouette?
- Update automatically a form inside a function of a plugin
- How to prepare (compress/zip) a plugin to enable updating instead of adding new instance?
- WordPress website will not show menu on a Mobile Device
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- WordPress Standard Fix Errors
- How to dynamically add template in Innerblock?
- any word search WordPress
- How to translate to spanish wordpress hardcoded content/files?
- Is there a tool to see every WordPress site that’s using a particular plugin?
- How to Create a Learning Management Plugin in WordPress to Manage Courses [LMS]
- Overwriting Plugin’s Ajax callback function from theme
- How to disable users to view Other pages
- How can I get the Post ID and Post Type within a Must Use Plugin?
- Can’t find variable is_single in my jQuery plugin
- WordPress Cron function is not working
- How to do rest APi with wordpress
- SSH vs WordPress
- WordPress Dashboard organize posts based on categories
- Find all strings between an enclosing shortcode
- Showing ads in the specific category and its sub-categories
- Plugins upload to wordpress in wampserver via filezilla
- Having trouble initializing wordpress within plugin
- Define constant for one plugin in mu-plugin
- Get content or excerpt of top rated votes @GD-Star Rating? [closed]
- Problem with permissions in wp-content/plugins
- What would cause edit buttons for plugins to disappear?
- Is an Office a custom post type [closed]
- What is the best way to change share image for social networks? [closed]
- wordpress or jquery a dynamic photo gallery
- How to add image for custom taxonomy
- Plugin Beauty Contact Popup Form with while loop
- I am experiencing difficulty fulfilling client request
- PHP Creating a formula from mysql db values and db stored math operator
- Filter custom post type returned from REST api
- WP Elementor Pro causing crtical failure on website
- Render CMB2 select option to post page [closed]