Standardize filters for single_(post|cat|tag|month)_title() on strip_tags() and wptexturize(). fixes #10900 props scribu

git-svn-id: http://svn.automattic.com/wordpress/trunk@13467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-02-27 18:57:04 +00:00
parent aa3e96bbd6
commit 9ee57d58a4
2 changed files with 11 additions and 5 deletions

View File

@ -86,6 +86,12 @@ foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description',
add_filter( $filter, 'esc_html' );
}
// Format titles
foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title' ) as $filter ) {
add_filter( $filter, 'wptexturize' );
add_filter( $filter, 'strip_tags' );
}
// Format text area for display.
foreach ( array( 'term_description' ) as $filter ) {
add_filter( $filter, 'wptexturize' );

View File

@ -574,7 +574,7 @@ function wp_title($sep = '»', $display = true, $seplocation = '') {
// If there is a post
if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
$post = $wp_query->get_queried_object();
$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
$title = apply_filters( 'single_post_title', $post->post_title );
}
// If there's a taxonomy
@ -652,9 +652,9 @@ function single_post_title($prefix = '', $display = true) {
}
$title = apply_filters('single_post_title', $post->post_title, $post);
if ( $display )
echo $prefix . strip_tags($title);
echo $prefix . $title;
else
return strip_tags($title);
return $title;
}
/**
@ -687,9 +687,9 @@ function single_cat_title($prefix = '', $display = true ) {
$my_cat_name = apply_filters('single_cat_title', $cat->name);
if ( !empty($my_cat_name) ) {
if ( $display )
echo $prefix . strip_tags($my_cat_name);
echo $prefix . $my_cat_name;
else
return strip_tags($my_cat_name);
return $my_cat_name;
}
}