Advertisement
supportnwl

Tag shortcode

Nov 4th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function em_tag_list(){
  2. $tags = get_terms(EM_TAXONOMY_TAG,'hide_empty=0');
  3. echo "<ul>";
  4. foreach ($tags as $tag) { //$tag->name
  5. echo '<li><a href="' . get_term_link( $tag->name, EM_TAXONOMY_TAG) . '">' . $tag->name .'</a></li>' ;
  6. }
  7. echo "</ul>";
  8. }
  9. add_shortcode('tag_list', 'em_tag_list');
  10.  
  11. //USAGE: [tag_list]
  12.  
  13. ===================================================================================
  14.  
  15. add_filter('em_tag_output_placeholder','my_em_placeholder_tag_mod',1,3);
  16. function my_em_placeholder_tag_mod($replace, $EM_Tag, $result){
  17. if ( $result == '#_TAGNOTES' ) {
  18. $replace = $EM_Tag->description;
  19. }
  20. return $replace;
  21. }
  22. //USAGE: #_TAGNOTES at event > formatting > event tags
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement