Ticket #13867: 13867.4.diff
File 13867.4.diff, 3.1 KB (added by , 7 years ago) |
---|
-
src/wp-includes/feed-rss2-comments.php
32 32 ?> 33 33 > 34 34 <channel> 35 <title> 36 <?php35 <title><?php 36 $page_title = ''; 37 37 if ( is_singular() ) { 38 38 /* translators: Comments feed title. 1: Post title */ 39 printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );39 $page_title = sprintf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() ); 40 40 } elseif ( is_search() ) { 41 41 /* translators: Comments feed title. 1: Site name, 2: Search query */ 42 printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );42 $page_title = sprintf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() ); 43 43 } else { 44 44 /* translators: Comments feed title. 1: Site name */ 45 printf( ent2ncr( __( 'Comments for %s' ) ),get_wp_title_rss() );45 $page_title = sprintf( ent2ncr( __( 'Comments for %s' ) ), get_bloginfo_rss( 'name' ) . get_wp_title_rss() ); 46 46 } 47 ?> 48 </title> 47 48 /** 49 * Filter the page title for the RSS2 comments feed. 50 * 51 * @since 4.9 52 * 53 * @param string $page_title RSS2 comments feed page title. 54 */ 55 echo apply_filters( 'rss_comments_page_title', $page_title, get_the_title_rss() ); 56 ?></title> 49 57 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 50 58 <link><?php ( is_single() ) ? the_permalink_rss() : bloginfo_rss( 'url' ); ?></link> 51 59 <description><?php bloginfo_rss( 'description' ); ?></description> … … 81 89 $comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID ); 82 90 ?> 83 91 <item> 84 <title> 85 <?php92 <title><?php 93 $item_title = ''; 86 94 if ( ! is_singular() ) { 87 95 $title = get_the_title( $comment_post->ID ); 88 96 /** This filter is documented in wp-includes/feed.php */ 89 97 $title = apply_filters( 'the_title_rss', $title ); 90 98 /* translators: Individual comment title. 1: Post title, 2: Comment author name */ 91 printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );99 $item_title = sprintf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() ); 92 100 } else { 93 101 /* translators: Comment author title. 1: Comment author name */ 94 printf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );102 $item_title = sprintf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() ); 95 103 } 96 ?> 97 </title> 104 105 /** 106 * Filter the title to use for an item in an RSS2 comments feed. 107 * 108 * @since 4.9 109 * 110 * @param string $item_title RSS2 comments feed item title. 111 * @param object $comment_post Comment post object. 112 */ 113 echo apply_filters( 'rss_comments_item_title', $item_title, $comment_post ); 114 ?></title> 98 115 <link><?php comment_link(); ?></link> 99 116 <dc:creator><![CDATA[<?php echo get_comment_author_rss(); ?>]]></dc:creator> 100 117 <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></pubDate>