Last active
September 29, 2018 08:45
-
-
Save lamberger/58277fb003818d7f5dc5b472eedc439e to your computer and use it in GitHub Desktop.
List all available shortcodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function list_all_shortcodes() { | |
| global $shortcode_tags; | |
| $shortcodes = $shortcode_tags; | |
| ksort( $shortcodes ); | |
| $output = '<p>Available shortcodes:</p><ul>'; | |
| foreach( $shortcodes as $code => $function ) { $output .= '<li>' . $code . '</li>'; } | |
| $output .= '</ul>'; | |
| return $output; | |
| } | |
| add_shortcode( 'allshortcodes', 'list_all_shortcodes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment