Solved

Generate a list of all WordPress shortcodes available in a theme

Posted on 2014-09-16
5
163 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
ID: 40325555
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
ID: 40325740
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
ID: 40326019
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
ID: 40326100
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
ID: 40328504
Thanks for the suggestions, guys.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

821 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