The code referenced in your question is still good. I double checked, and this worked for me:
function wpse_script_loader_tag( $tag, $handle ) {
if ( 'jquery-fluidbox' !== $handle ) {
return $tag;
}
return str_replace( ' src', ' data-cfasync="false" src', $tag );
}
add_filter( 'script_loader_tag', 'wpse_script_loader_tag', 10, 2 );
(I tested with a different script handle, but that won’t matter):

Related Posts:
- How to add defer=”defer” tag in plugin javascripts?
- How to add a custom CSS class to core blocks in Gutenberg editor?
- Why is javascript allowed in my post content?
- How to pass/get data to/from the WooCommerce data-product_variations object?
- AJAX filter posts on click based on category
- Remove left alignment option in core/image block
- How can I filter block registration based on post-type? (Block alignment settings)
- When to use add_action when registering/enqueuing scripts
- Remove CSS & JS files from WordPress Main Page For Increase Pagespeed?
- How do I add tags to entire comments, not just their text
- “The editor has encountered an unexpected error” After add defer tag to java script
- How to bridge the gap between dynamic back-end data and front-end output?
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- This code works, but breaks the media uploader. How do I integrate it in a way that won’t?
- Limit total tags in the_content
- Add custom options to the wplink dialog
- How to show page content in feed?
- remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
- How can I add information underneath the user’s name on the users.php page?
- Is calling function_exists() faster or slower that apply_filters()
- Filtered query_vars becomes global. Why does this work?
- Can I add custom meta for each image uploaded via media-upload.php?
- Alter only the page title, not the post titles within
- Load different template file when condition met?
- Problem getting single_template filter to work – I want to serve a different single.php file for posts in a certain category
- Too many actions/filters!
- How can override a add_filter of a plugin?
- Adding Filter Conditionally Per Page ID
- Nested calls the the_content filter
- How to change domain used when pinging sites
- Clean-up script tags
- Is it possible to track down Actions and Filters?
- Return a custom value in a function added to an action hook
- Using Conditional Statement in functions.php
- Adding id and class to the search input in WordPress search form
- Multiple filters for wp_get_archive
- Filter and modify entry-footer link in twentyseventeen
- Function the_content not working
- How to order by taxonomy using wp_query
- Filter taxonomy admin pagination
- Feed, RSS not able to clear the cache and cannot change the limit of cache life time
- WP action/filter to modify title before header output and article output?
- Custom view counts not updating correctly
- WP Filter to change the URL of an Anchor wrapping the last gallery image
- Gutenberg – Add align controls to a custom block
- To add a custom filter based on a meta field
- I can not include page to wordpress function add_filter, the_content
- How to create Woocommerce Product Filter Widget [closed]
- Add default user field to WooCommerce checkout [closed]
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- Create Search Form to Filter Through Terms
- wp_mail works with add_action(‘save_post’, …) but not an ajax action
- add_filter with retrieve_password_message() not working in plugin, but works in functions.php
- Add a div of content within the_content after a certain block
- Gutenberg Block – Post Featured Image Filter Hook
- Is it possible to put the add-filter()-hook into a function?
- How can I return shortcode output to the top of the content?
- separate categories with comma and srounded by single quote
- Filter for when the post is updated
- Prevent add_filter being applied to wp-admin pages
- Filter a pluggable function
- apply_filters(‘get_the_content’, $content) + Except
- Filter everything from content except output of a shortcode
- Filter have_posts()/ the_post()
- Is there a way to globallly apply esc_html( … ) to all inputs and anchors to filter out XSS markup?
- Filter get_page_by_path()
- Handle multiple parameters in filter
- How to add filter in custom rss feed
- Want to use wp_get_current_user() in query filter
- Apply wordpress filter checking category
- How To Get Search Term and Use in Function
- alternative to the_content filter
- How to set a filter search for categories of blog posts in wordpress
- Filter widget_posts_args not working
- Filter the title to only affect the_title() template function
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- Adding link options in insert/edit link dialog window
- How can I limit access to uploaded media depending on the logged in user’s user role?
- How can I filter same content in page
- WordPress Tag Cloud Filter Prevents Widget HTML from loading
- Using add_filters() , apply_filter(), add_action() and do_action() in extending a plugin
- Adding Filter | Page Title | Template | Why the_title affecting on menu?
- gettext filter does nothing
- Code restricted to dashboard, running unexpectedly in the frontend (pre_get_post and admin-ajax.php)
- Hide a specific post from Archive Feed
- Filter for wp_embed_handler_youtube not working
- Post Type Upload Directory – {post_type}_upload_dir filter
- Filter on widget-title does not work with custom links
- Custom registration field to SQL database
- Problem with shortcodes in external file
- WordPress URL rewrite problem
- How to reset/remove added filters ‘posts_join’ and ‘posts_orderby’ after the loop is completed?
- Which hook should be used in this case?
- Add a filter conditionally based on frontpage
- Using two posts_orderby add_filter makes conflict
- custom post filter based on Visitors country
- How to correctly override a filter?
- Is there a way to check if the ‘wp_sitemaps_enabled’ is true or false?
- Block Gutenberg Editor manually by User Roles with a Filter with code
- Accidentally created 2 pages, same name. Changing permalink on one changes both