Make WordPress Core

Changeset 3314


Ignore:
Timestamp:
12/15/2005 10:20:06 PM (21 years ago)
Author:
ryan
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-commentsrss2.php

    r3196 r3314  
    2121                $i++;
    2222?>
    23         <title><?php if (is_single() || is_page()) { echo "Comments on: "; the_title_rss(); } else { bloginfo_rss("name"); echo " Comments"; } ?></title>
     23        <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>
    2424        <link><?php (is_single()) ? permalink_single_rss() : bloginfo_rss("url") ?></link>
    2525        <description><?php bloginfo_rss("description") ?></description>
     
    5252?>
    5353        <item>
    54                 <title>by: <?php comment_author_rss() ?></title>
     54                <title><?php if ( ! (is_single() || is_page()) ) {
     55                        $title = get_the_title($comment->comment_post_ID);
     56                        $title = apply_filters('the_title', $title);
     57                        $title = apply_filters('the_title_rss', $title);
     58                        printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss());
     59                } else {       
     60                        printf(__('by: %s'), get_comment_author_rss());                 
     61                } ?></title>
    5562                <link><?php comment_link() ?></link>
    5663                <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate>
     
    5966                        if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) {
    6067                        ?>
    61                 <description>Protected Comments: Please enter your password to view comments.</description>
     68                <description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description>
    6269                <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
    6370                        <?php
  • trunk/wp-includes/feed-functions.php

    r3140 r3314  
    1010}
    1111
    12 function the_title_rss() {
     12function get_the_title_rss() {
    1313        $title = get_the_title();
    1414        $title = apply_filters('the_title', $title);
    1515        $title = apply_filters('the_title_rss', $title);
    16         echo $title;
     16        return $title;
     17}
     18
     19function the_title_rss() {
     20        echo get_the_title_rss();
    1721}
    1822
     
    6367}
    6468
     69function get_comment_author_rss() {
     70        return apply_filters('comment_author_rss', get_comment_author() );
     71}
    6572function comment_author_rss() {
    66         $author = apply_filters('comment_author_rss', get_comment_author() );
    67         echo $author;
     73        echo get_comment_author_rss();
    6874}
    6975
Note: See TracChangeset for help on using the changeset viewer.