Another old unanswered question. Hopefully useful to someone in the future.
WordPress stores shortcode tags and callbacks in the $shortcode_tags. This is how I’d do it.
function my_the_content( $content ) {
global $shortcode_tags;
$tag= 'some_shortcode';
//* Make sure it's actually a valid shortcode
if( ! isset( $shortcode_tags[ $tag ] ) ) {
return $content;
}
$func = $shortcode_tags[ $tag ];
remove_shortcode( $tag );
//* Do something useful
//* Restore the shortcode
add_shortcode( $tag, $func );
return $content;
}
Related Posts:
- Using action hooks inside of a shortcode
- manipulate a plugins shortcode
- Enclosing Shortcode Within Another Enclosing Shortcode Breaks Output Functionality
- Convert HTML Script to Shortcode [closed]
- How can I collect and output all attributes of all executed ShortCodes?
- Modifying the wordpress login page and then referencing it with a shortcode problem
- contact form 7 :create shortcode usable in email message [closed]
- Which method to use when deleting posts from the front-end
- Hook into existing shortcodes to manipulate the attributes?
- Conditionally Loading JavaScript/CSS for Shortcodes
- Show shortcode without executing it
- How to create a shortcode with 1 parameter (atts)
- shortcodes output before content [duplicate]
- How does a shortcode work?
- Run visual composer code in php page
- Remove wptexturize from a shortcode?
- Using shortcode in Post title
- WordPress adds br in between my shortcode
- Shortcodes, HTML tables, and multiple rows
- Audio or playlist shortcode condition according to the amount of files on attachment page
- Does a shortcode with a single attribute have to use an array?
- WP_enqueue_script inside shortcode?
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- template_redirect to accompany with a shortcode
- How navigation works in custom loop within shortcode?
- Use [shortcode=”value”] instead of [shortcode att=”value”]?
- Tinymce shortcodes within shortcode contents
- I dont want to show shortcode in tag
- Post loop created via shortcode not displaying shortcode in content
- Pass shortcode variables to template
- passing multiple parents value into a shortcode
- Is it possible to add a repeater field to TinyMCE’s option window?
- How do I preview the result of a shortcode in the TinyMCE editor?
- Searching in shortcode contents
- Applying filters to the_content() to separate content if any `add_shortcode()` is found?
- Wp_localize_script from Shortcode [closed]
- Localization inside shortcode not working
- Font Awesome Icons Won’t Work
- How to Get a part of URL and put in shortcode?
- Get shortcode attribute outside of WordPress
- Overriding shortcode $atts for featured products
- How to create a shortcode for embedding pdf in iframe?
- Woocommerce, ordering products by default on shortcode pages
- detect when shortcode ran for the last time
- How can a shortcode can take the place of the featured image in a post?
- Shortcode for Twitter Bootstrap Collapse
- Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?
- get_shortcode_regex() only matches first shortcode
- Looking for a way to include/embed text from a file on a page so that the short codes are processed
- Different uniqid when calld in wp_localize_script and shortcode
- How do I debug a short code?
- Gravity forms customize field markup for the same form appearing in different places
- How to type shortcode-like text in WordPress TinyMCE visual editor?
- Does registering multiple shortcodes impact performance?
- Gallery shortcode – change link file image size? (not using default fullsize image)
- How can I hide the Permalink/Shortlink for certain user logged in Users of a certain level?
- How to force that styles are enqueued in the header?
- add action only if gallery shortcode attribute is equal to?
- How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]
- Shortcode for order number [closed]
- Create shortcode in WordPress, using one variable in 3 functions?
- Edit shortcode in post content programatically
- Adding javascript actions to words in post content
- How to change to local video player on shortcode ultimate to video.js?
- Buddypress shortcode for tabs [closed]
- PHP Running On CMS Side of WordPress
- Basic do shortcodes question
- What is this format called (nested shortcodes)?
- Problem with height in video shortcode
- When are Shortcode Attributes Available in Template
- How can I insert a shortcode in the title tag of another?
- Shortcode inside text widget do not call enqueue style
- How to create a dropdown of shortcodes in edit mode for posts
- Checking post content for a shortcode, but content is being returned as empty
- do_shortcode() won’t return PHP Array
- Excerpt Length & List Category Posts Plugin
- Show shortcode only in posts
- get_queried_object_id / short code returning blank
- shortcode to display specific recent posts
- How to test If a post has a particular term
- Multiple values for one variable
- Function in a wordpress shortcode
- shortcode is not rendered
- Impossible to display modification in shortcode code?
- Use Shortcode on Custom Page
- WordPress Database Error using $wpdb->get_results()
- Ajax callback and shortcode functionality
- Automatically add class-attribute to gallery?
- Duplicate short code duplicating some values only
- Video Shortcode Only Returning a Link
- Loading shortcode stylesheet only when shortcode is in text widget [closed]
- Members only Passthrough
- How to add a nested shortcode into editor?
- Shortcode with multiple variables
- Can’t get default values to work with custom shortcode
- How create a shortcode with html
- Adding shortcode [closed]
- do_shortcode autommatic content generation
- Using $variable in shortcode
- Free Add to Cart Button on WooCommerce with Elementor – No Premium [closed]