I am not good at Regex but do_shortcode
will basically will not parse any shortcode in the attributes, this might help you out:
add_filter('the_content', function($c){
$pattern = '/<span\s*(.*?)data-value=["\']?\[(.*?)\]["\']?\s*(.*?)>\s*(.*?)\s*<\/span>/si';
$c = preg_replace_callback($pattern, function($c){
return isset( $c[2] ) ? str_replace(
$c[2],
do_shortcode("[{$c[2]}]"),
$c[0]
) : array_pop($c);
}, $c);
return $c;
});
Related Posts:
- How to add a shortcode button to the TinyMCE editor?
- how to include other plugins css files in a shortcode?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- Autogenerate wordpress shortcodes using array?
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Shortcode under a Shortcode Multiple times Possible?
- shortcode doesn’t work
- do_shortcode() doesn’t work if shortcode contained in variable, works if shortcode passed as string
- How extend shortcode default values for a plugin?
- how to show database content in wordpress post
- wp_specialchars and wp_specialchars_decode in a shortcode plugin
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- echo do_shortcode is not working on theme’s template
- Can wp_localize_script be used within a shortcode?
- Shortcode to generate and save password in a file
- Force [wordpress_social_login] shortcode to display where it is embedded [closed]
- Overriding Attributes values in Shortcode Plugins
- Demystifying and understanding shortcode nomenclature
- How to modify shortcode attributes with data from current post
- Add htmlentities and/or shortcode into data-attributes
- Custom CSS for plugin form
- Any Short code Availble for Get Post List With Thumbnail Plugin?
- Where to call add_shortcode function in WordPress Plugin Boilerplate?
- Plugin echos text from shortcode function in gutenberg page editor
- Shortcode based chart plugin
- tag breaks shortcode output (other solutions don’t work)
- Input with spaces in Shortcode attributes overwritten by defaults
- Allow users of my plugin to define their own shortcode rather than use mine?
- wordpress prevent multiple shortcodes
- add_shortcode is not working in plugin where others are working
- Single API call exposed via shortcode with params
- SEO Friendly URL on dynamic product page produced via shortcode
- Best place for short bio,image and button [closed]
- Some code in shortcode function being ignored
- Unable to add TAB character to post?
- plugin shortcode output
- How to Create a shortcode to this php function
- How do I apply style to each category of a list?
- What is @Action in WordPress?
- Where are theme codes located for WordPress?
- Anyway to convert a plugin to become a shortcode?
- How to have sample page for each new register users in a membership website
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- using do_shortcode
- plugin shortcode not working on ajax request call
- Modify page title and subtitle with a plugin
- Add Shortcode tag in Widget/Sidebar
- Flipping Book PHP Code? Any experience?
- WPTouch – how to remove shortcodes or make shortcodes function
- Custom shortcode for displaying user based on a role parameter
- WordPress Plugin Insert Html Code with Shortcode
- Get all the URLs of the pages that uses a specific shortcode
- shortcode – multiple instances of same parameter name in one shortcode instance
- Function call in wordpress short code handler fails
- Get Image Having the ID [closed]
- Add the_post_thumbnail_url to a shortcode in function.php
- Is there any way to inject text onto pages?
- how to check if a shortcode is used more than one time in the same post
- Adding a Tag Parameter / Filter to My Shortcode
- grab or load text on demand
- How can I replace content on site generated from plugin without changing plugin
- Rename Smart YouTube’s httpv back to http for all posts
- How to use a shortcode or an application to dynamically embed content from one WordPress site to another?
- Managing and deleting transients with dynamically generated transient names
- how to display a template.php in a shortcode
- Thumbnail image doesn’t show up in Shortcode output
- list of custom post by custom field in frontend
- get_post_meta shortcode returns empty field
- Shortcode do not return the right data in post
- Why does my custom plugin only function correctly once per page?
- JS working when used normally but not in wordpress
- Make the product page as homepage WooCommerce
- WordPress Shortcodes – Return $Variable
- Shortcode function not showing up on mobile browser
- shortcodes not working [dt_carousel & [dt_fancy_image
- How to pass multiple custom fields as shortcode’s parameters
- Shortcode generated widget to appear on same line as heading text and button
- Do_shortcode before send email content
- Get shortcode attribute for AJAX call
- How to use a shortcode of a plugin in another plugin php file
- Bootstrap carousel – Using shortcode inside enclosing shortcode
- How to store multiple instances of the plugin’s options for various shortcodes
- Modify Plugin shortcode function code
- wordpress Shortocode running twice?
- Shortcode in a blog post, footer and related products stop working
- Using “excerpt_more” filter for a specific post type
- Allow user to input shortcode into wordpress widget
- Space in WordPress Attribute Causing Problems
- Shortcode registered from a plugin not recognized
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Strip shortcode from excerpt [duplicate]
- How to use ‘Event Manager Shortcodes’ plugin via the php code? [closed]
- Next and Previous Pagination button not displaying in WordPress
- WordPress shortcode plugin not working
- WP Customer Reviews call short code on another page [closed]
- Shortcode returning specific content of a post
- cURL External API request displays content above other content on page
- Beginner question: Accessing js script in plugin
- thumbnail_width not working in wordpress most popular post plugin
- Display file contents within Plugin