Last active
May 16, 2016 19:26
-
-
Save hunk/b93edf339e63fa18e7178be30f9c2682 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
function callback_categories_function() { | |
global $post; | |
$categories = get_the_category(); | |
$all = array(); | |
foreach ($categories as $cat) { | |
$all[] = $cat->category_nicename; | |
} | |
return implode(",",$all); | |
} | |
function register_shortcodes(){ | |
add_shortcode('show_categories', 'callback_categories_function'); | |
} | |
add_action( 'init', 'register_shortcodes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment