WordPress.org

Make WordPress Core

Changeset 24783


Ignore:
Timestamp:
07/23/13 16:05:40 (9 months ago)
Author:
markjaquith
Message:

Allow the_title_attribute() to receive a post argument, and use this in get_adjacent_post_rel_link() to make sure tags are stripped from the title output there.

Fixes #24232.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r24664 r24783  
    12211221        return; 
    12221222 
    1223     if ( empty($post->post_title) ) 
     1223    $post_title = the_title_attribute( array( 'echo' => false, 'post' => $post ) ); 
     1224 
     1225    if ( empty( $post_title ) ) 
    12241226        $post_title = $previous ? __('Previous Post') : __('Next Post'); 
    1225     else 
    1226         $post_title = $post->post_title; 
    12271227 
    12281228    $date = mysql2date(get_option('date_format'), $post->post_date); 
     
    12301230    $title = str_replace('%title', $post_title, $title); 
    12311231    $title = str_replace('%date', $date, $title); 
    1232     $title = apply_filters('the_title', $title, $post->ID); 
    12331232 
    12341233    $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='"; 
  • trunk/wp-includes/post-template.php

    r24598 r24783  
    7070 */ 
    7171function the_title_attribute( $args = '' ) { 
    72     $title = get_the_title(); 
     72    $defaults = array('before' => '', 'after' =>  '', 'echo' => true, 'post' => get_post() ); 
     73    $r = wp_parse_args($args, $defaults); 
     74    extract( $r, EXTR_SKIP ); 
     75 
     76    $title = get_the_title( $post ); 
    7377 
    7478    if ( strlen($title) == 0 ) 
    7579        return; 
    76  
    77     $defaults = array('before' => '', 'after' =>  '', 'echo' => true); 
    78     $r = wp_parse_args($args, $defaults); 
    79     extract( $r, EXTR_SKIP ); 
    8080 
    8181    $title = $before . $title . $after; 
Note: See TracChangeset for help on using the changeset viewer.