0

I would like to be able to programatically find out what handler is registered to a particular shortcode. I want to be able to find this so I can save it, change it, perform a do_shortcode, then change it back to what it was originally.

I understand WordPress has a gobal variable $wp_filter for registered filters... Is there and equivalent for shortcodes?

0

2 Answers 2

1

The below WordPress snippet will give you a list of all the WordPress shortcodes you have available on your blog.

<?php
        global $shortcode_tags;
        echo '<pre>'; 
        print_r($shortcode_tags); 
        echo '</pre>';
?>

Also check the Codex for more information about shortcodes

1
  • Temporarily you can append this to the bottom of your /index.php to ensure all of WP has been processed. Commented May 14, 2016 at 21:39
0

Found it $shortcode_tags

If you do printer( $shortcode_tags ) you will get a listing of registered tags

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.