Solved

Generate a list of all WordPress shortcodes available in a theme

Posted on 2014-09-16
5
159 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

How to install BuddyPress on your self-hosted WordPress site It’s been called everything from “social networking in a box” to “Facebook without the terms of service,” but until Feb. 16, BuddyPress was a relatively unknown outside the WordPress MU…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
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…

863 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

26 Experts available now in Live!

Get 1:1 Help Now