[wp-hackers] the_tags does not apply_filters('the_tags')
Silverstein, Jesse
Jesse.Silverstein at xerox.com
Mon Apr 6 19:27:06 GMT 2009
See also: http://core.trac.wordpress.org/ticket/9436
Sorry for the spam.
-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of
Silverstein, Jesse
Sent: Monday, April 06, 2009 3:22 PM
To: wp-hackers at lists.automattic.com
Subject: RE: [wp-hackers] the_tags does not apply_filters('the_tags')
Wow, that was a lot of extra line breaks. Guess I shouldn't write to
this list in html.
Anyway, update:
The exact same code goes back as far as WP 2.5.1 (that's as far back I
can check readily). That leads me to believe it IS the desired behavior,
but I don't understand why.
Isn't standard practice for templates to have <?php the_tags(); ?> or
some variant of that? That's how all the templates I've checked display
tags, including WP Default and WP Classic. And if it is standard,
shouldn't "the_tags" filter be called during that function?
Dev-feedback would be appreciated.
-Jesse Silverstein
-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of
Silverstein, Jesse
Sent: Monday, April 06, 2009 3:09 PM
To: wp-hackers at lists.automattic.com
Subject: [wp-hackers] the_tags does not apply_filter('the_tags')
As the subject states, calling the_tags() does not
apply_filters('the_tags', ...) In order to get the filter applied, you
have to call get_the_tag_list()
At least in 2.8-bleeding.
Is this the desired behavior?
If not, it could be fixed by changing:
function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) {
return the_terms( 0, 'post_tag', $before, $sep, $after );
}
to:
function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) {
return get_the_tag_list ( $before, $sep, $after );
}
-Jesse Silverstein
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.43/2043 - Release Date:
04/06/09 06:22:00
More information about the wp-hackers
mailing list