Support » Plugins » the_tags and add_filter

  • Resolved Tec


    So, I was trying to update one of my personal plugins. I’m trying to apply a filter to the_tags filter with this code.

    add_filter('the_tags', 'tag2lowercase');

    I know I got that right but I can’t seem to make it work. No filters are being applied to the_tags. On the other hand, it works well with wp_tag_cloud. Anyone knows if this is a bug or something. And aside from tinkering with category-template.php, is there a way for me to force lowercase in my tags?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Kyou,

    This is odd, but The hook the_tags does not get used by the function the_tags. Please try this code:

    add_filter( "term_links-post_tag", 'tag2lowercase' );
    function tag2lowercase( $c ){
    	foreach( (array) $c as $k => $v ){
    		$a[] = strtolower( $v );
    	return $a;

    Hi mfields! Thanks a lot for the code. I was finally able to make it work. 🙂

    Thanks a lot. The code resolved my problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘the_tags and add_filter’ is closed to new replies.