Solved

Generate a list of all WordPress shortcodes available in a theme

Posted on 2014-09-16
5
157 Views
Last Modified: 2014-09-17
Is there any way to get a list of all shortcodes available in an installed theme? Preferably, with available parameters. I found one plugin, but it doesn't list the parameters, only the shortcodes:

http://wordpress.org/plugins/shortcode-dropdown/

If I can't do this from within WordPress, or by generating a custom page of some kind, then can I find this out by digging through the theme files somewhere? Not sure where to look.

Thanks!
0
Comment
Question by:bbdesign
  • 2
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
Ugh.  This would be handy.

At this time, the only way to do it that I know of is to look through functions.php and follow the code there and see where it takes you. Some themes make a ton of calls to external class files so you have to really understand the theme construction to be successful.

Please note that the above would work for theme-based short codes.  Codes found In the core or in plugins are located elsewhere.
0
 
LVL 32

Accepted Solution

by:
DrDamnit earned 250 total points
Comment Utility
Shortcodes (if I remember correctly) are loaded into array. So, it stands to reason that of you dumped the array contents, you can get your list.

As far as parameters go, however, you have to either look at the code or is documentation.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 250 total points
Comment Utility
So, it stands to reason that of you dumped the array contents, you can get your list.

Mike, I'm pretty sure that's what the plugin listed above does, albeit with integration into TinyMCE for style points.  Oddly enough, that plugin has zero activity, not sure why.

You're 100% right, though:

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

Open in new window


ref: http://wordpress.org/support/topic/how-to-list-all-active-shortcodes
0
 
LVL 32

Expert Comment

by:DrDamnit
Comment Utility
Yeah, so to get the list he wants, he can disable the theme, then dump the array. Then enable the theme, and dump the array again. The "new" items in the second dump would be the shortcodes he wants. (You'd have to diff the two lists)
0
 

Author Comment

by:bbdesign
Comment Utility
Thanks for the suggestions, guys.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Did you use a default hosting installation of wordpress with the intention of it being your actual site?  Maybe you’ve installed it as a Blog to your current site and recently converted it to be the main site and do away with the old .htm pages.  An…
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now