WordPress.org

Make WordPress Core

Ticket #24232: 24232.2.diff

File 24232.2.diff, 1.8 KB (added by markjaquith, 20 months ago)
  • wp-includes/link-template.php

    function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $ex 
    12201220        if ( empty($post) ) 
    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); 
    12291229 
    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='"; 
    12351234        $link .= esc_attr( $title ); 
  • wp-includes/post-template.php

    function the_title($before = '', $after = '', $echo = true) { 
    6969 * @return string|null Null on failure or display. String when echo is false. 
    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; 
    7680 
    77         $defaults = array('before' => '', 'after' =>  '', 'echo' => true); 
    78         $r = wp_parse_args($args, $defaults); 
    79         extract( $r, EXTR_SKIP ); 
    80  
    8181        $title = $before . $title . $after; 
    8282        $title = esc_attr(strip_tags($title)); 
    8383