Make WordPress Core

Ticket #25229: wp-includes-feed-rss2-comments.diff

File wp-includes-feed-rss2-comments.diff, 2.5 KB (added by dustyf, 11 years ago)

First pass at wp-includes/feed-rss2-comments.php

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

     
    1414        xmlns:dc="http://purl.org/dc/elements/1.1/"
    1515        xmlns:atom="http://www.w3.org/2005/Atom"
    1616        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    17         <?php do_action('rss2_ns'); do_action('rss2_comments_ns'); ?>
    18         >
     17        <?php
     18        //duplicate_hook
     19        do_action('rss2_ns');
     20        ?>
     21
     22        <?php
     23        /**
     24         * Fired at the end of the RSS root to add namespaces.
     25         *
     26         * @since 2.8.0
     27         */
     28        do_action('rss2_comments_ns');
     29        ?>
     30>
    1931<channel>
    2032        <title><?php
    2133                if ( is_singular() )
     
    2941        <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
    3042        <description><?php bloginfo_rss("description") ?></description>
    3143        <lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
     44        <?php //duplicate_hook ?>
    3245        <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
     46        <?php //duplicate_hook ?>
    3347        <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
    34         <?php do_action('commentsrss2_head'); ?>
     48        <?php
     49        /**
     50         * Fired at the end of the RSS2 comment Feed Header.
     51         *
     52         * @since 2.3.0
     53         */
     54        do_action('commentsrss2_head');
     55        ?>
    3556<?php
    3657if ( have_comments() ) : while ( have_comments() ) : the_comment();
    3758        $comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
     
    4061                <title><?php
    4162                        if ( !is_singular() ) {
    4263                                $title = get_the_title($comment_post->ID);
     64                                //duplicate_hook
    4365                                $title = apply_filters('the_title_rss', $title);
    4466                                printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
    4567                        } else {
     
    5779                <description><![CDATA[<?php comment_text_rss() ?>]]></description>
    5880                <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded>
    5981<?php endif; // post pass
    60         do_action('commentrss2_item', $comment->comment_ID, $comment_post->ID);
     82        $comment_id = $comment->comment_ID;
     83        $comment_post_id = $comment_post->ID;
     84        /**
     85         * Fired at the end of each RSS2 comment feed item.
     86         *
     87         * @since 2.1.0
     88         *
     89         * @param $comment_id The ID of the comment being displayed.
     90         * @param $comment_post_id The ID of the post connected to the comment.
     91         */
     92        do_action('commentrss2_item', $comment_id, $comment_post_id);
    6193?>
    6294        </item>
    6395<?php endwhile; endif; ?>