Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Generate a list of all WordPress shortcodes available in a theme

Posted on 2014-09-16
5
Medium Priority
?
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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 1000 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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

Like there are many different versions of Wordpress, there are also a handful of related side projects WordPress users should be familiar with.   All of these projects are open source and GPL licensed, which means there are few restrictions to us…
Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
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…

705 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