Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add post titles to site comment feed. Add some gettext. fixes #2067 #…

…1987

git-svn-id: http://svn.automattic.com/wordpress/trunk@3314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit ee7b57220277011d8b6dc5c0232e2a1df7a363c4 1 parent c676e9c
ryan authored
Showing with 20 additions and 7 deletions.
  1. +10 −3 wp-commentsrss2.php
  2. +10 −4 wp-includes/feed-functions.php
View
13 wp-commentsrss2.php
@@ -20,7 +20,7 @@
if ($i < 1) {
$i++;
?>
- <title><?php if (is_single() || is_page()) { echo "Comments on: "; the_title_rss(); } else { bloginfo_rss("name"); echo " Comments"; } ?></title>
+ <title><?php if (is_single() || is_page() ) { printf(__('Comments on: %s'), get_the_title_rss()); } else { printf(__('Comments for %s'), get_bloginfo_rss("name")); } ?></title>
<link><?php (is_single()) ? permalink_single_rss() : bloginfo_rss("url") ?></link>
<description><?php bloginfo_rss("description") ?></description>
<pubDate><?php echo gmdate('r'); ?></pubDate>
@@ -51,14 +51,21 @@
get_post_custom($comment->comment_post_ID);
?>
<item>
- <title>by: <?php comment_author_rss() ?></title>
+ <title><?php if ( ! (is_single() || is_page()) ) {
+ $title = get_the_title($comment->comment_post_ID);
+ $title = apply_filters('the_title', $title);
+ $title = apply_filters('the_title_rss', $title);
+ printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss());
+ } else {
+ printf(__('by: %s'), get_comment_author_rss());
+ } ?></title>
<link><?php comment_link() ?></link>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate>
<guid><?php comment_link() ?></guid>
<?php
if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) {
?>
- <description>Protected Comments: Please enter your password to view comments.</description>
+ <description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description>
<content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
<?php
} else {
View
14 wp-includes/feed-functions.php
@@ -9,11 +9,15 @@ function bloginfo_rss($show = '') {
echo get_bloginfo_rss($show);
}
-function the_title_rss() {
+function get_the_title_rss() {
$title = get_the_title();
$title = apply_filters('the_title', $title);
$title = apply_filters('the_title_rss', $title);
- echo $title;
+ return $title;
+}
+
+function the_title_rss() {
+ echo get_the_title_rss();
}
function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
@@ -62,9 +66,11 @@ function comment_link() {
echo get_comment_link();
}
+function get_comment_author_rss() {
+ return apply_filters('comment_author_rss', get_comment_author() );
+}
function comment_author_rss() {
- $author = apply_filters('comment_author_rss', get_comment_author() );
- echo $author;
+ echo get_comment_author_rss();
}
function comment_text_rss() {
Please sign in to comment.
Something went wrong with that request. Please try again.