Make WordPress Core

Ticket #13867: 13867.2.diff

File 13867.2.diff, 2.6 KB (added by stevenkword, 10 years ago)

updates hook doc

  • src/wp-includes/feed-rss2-comments.php

     
    3333>
    3434<channel>
    3535        <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() );
    4253        ?></title>
    4354        <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    4455        <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
     
    6576        ?>
    6677        <item>
    6778                <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
    7083                                /** This filter is documented in wp-includes/feed.php */
    7184                                $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() );
    7387                        } else {
    74                                 printf(ent2ncr(__('By: %s')), get_comment_author_rss());
     88                                $item_title = sprintf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );
    7589                        }
     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 );
    76100                ?></title>
    77101                <link><?php comment_link() ?></link>
    78102                <dc:creator><![CDATA[<?php echo get_comment_author_rss() ?>]]></dc:creator>