WordPress.org

Make WordPress Core

Changeset 13467


Ignore:
Timestamp:
02/27/2010 06:57:04 PM (8 years ago)
Author:
nacin
Message:

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-filters.php

    r13399 r13467  
    8585    add_filter( $filter, 'convert_chars' );
    8686    add_filter( $filter, 'esc_html'      );
     87}
     88
     89// Format titles
     90foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title' ) as $filter ) {
     91    add_filter( $filter, 'wptexturize' );
     92    add_filter( $filter, 'strip_tags'  );
    8793}
    8894
  • trunk/wp-includes/general-template.php

    r13461 r13467  
    575575    if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
    576576        $post = $wp_query->get_queried_object();
    577         $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
     577        $title = apply_filters( 'single_post_title', $post->post_title );
    578578    }
    579579
     
    653653    $title = apply_filters('single_post_title', $post->post_title, $post);
    654654    if ( $display )
    655         echo $prefix . strip_tags($title);
     655        echo $prefix . $title;
    656656    else
    657         return strip_tags($title);
     657        return $title;
    658658}
    659659
     
    688688    if ( !empty($my_cat_name) ) {
    689689        if ( $display )
    690             echo $prefix . strip_tags($my_cat_name);
     690            echo $prefix . $my_cat_name;
    691691        else
    692             return strip_tags($my_cat_name);
     692            return $my_cat_name;
    693693    }
    694694}
Note: See TracChangeset for help on using the changeset viewer.