Ticket #13867: 13867.2.diff
File 13867.2.diff, 2.6 KB (added by , 10 years ago) |
---|
-
src/wp-includes/feed-rss2-comments.php
33 33 > 34 34 <channel> 35 35 <title><?php 36 if ( is_singular() ) 37 printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() ); 38 elseif ( is_search() ) 39 printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() ); 40 else 41 printf( ent2ncr( __( 'Comments for %s' ) ), get_bloginfo_rss( 'name' ) . get_wp_title_rss() ); 36 $page_title = ''; 37 if ( is_singular() ) { 38 $page_title = sprintf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() ); 39 } elseif ( is_search() ) { 40 $page_title = sprintf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() ); 41 } else { 42 $page_title = sprintf( ent2ncr( __( 'Comments for %s' ) ), get_bloginfo_rss( 'name' ) . get_wp_title_rss() ); 43 } 44 45 /** 46 * Filter the page title for the RSS2 comments feed. 47 * 48 * @since 4.3.0 49 * 50 * @param string $page_title RSS2 comments feed page title. 51 */ 52 echo apply_filters( 'rss_comments_page_title', $page_title, get_the_title_rss() ); 42 53 ?></title> 43 54 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 44 55 <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link> … … 65 76 ?> 66 77 <item> 67 78 <title><?php 68 if ( !is_singular() ) { 69 $title = get_the_title($comment_post->ID); 79 $item_title = ''; 80 if ( ! is_singular() ) { 81 $title = get_the_title( $comment_post->ID ); 82 70 83 /** This filter is documented in wp-includes/feed.php */ 71 84 $title = apply_filters( 'the_title_rss', $title ); 72 printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss()); 85 86 $item_title = sprintf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() ); 73 87 } else { 74 printf(ent2ncr(__('By: %s')), get_comment_author_rss());88 $item_title = sprintf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() ); 75 89 } 90 91 /** 92 * Filter the title to use for an item in an RSS2 comments feed. 93 * 94 * @since 4.3.0 95 * 96 * @param string $item_title RSS2 comments feed item title. 97 * @param object $comment_post Comment post object. 98 */ 99 echo apply_filters( 'rss_comments_item_title', $item_title, $comment_post ); 76 100 ?></title> 77 101 <link><?php comment_link() ?></link> 78 102 <dc:creator><![CDATA[<?php echo get_comment_author_rss() ?>]]></dc:creator>