Skip to content

Instantly share code, notes, and snippets.

@lamberger
Last active September 29, 2018 08:45
Show Gist options
  • Select an option

  • Save lamberger/58277fb003818d7f5dc5b472eedc439e to your computer and use it in GitHub Desktop.

Select an option

Save lamberger/58277fb003818d7f5dc5b472eedc439e to your computer and use it in GitHub Desktop.
List all available shortcodes
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