WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/04/2015 05:46:41 PM (4 years ago)
Author:
wonderboymusic
Message:

Feeds: <comments> is optional in RSS2, so don't include it when comments aren't present or open. Same for <wfw:commentRss> and <slash:comments>

Adds unit test.

Props swissspidy, realloc, hakre, sivel.
Fixes #9134.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/feed-atom.php

    r35294 r35506  
    7979     */
    8080    do_action( 'atom_entry' );
     81
     82    if ( get_comments_number() || comments_open() ) :
    8183        ?>
    8284        <link rel="replies" type="<?php bloginfo_rss('html_type'); ?>" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
    8385        <link rel="replies" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link(0, 'atom') ); ?>" thr:count="<?php echo get_comments_number()?>"/>
    8486        <thr:total><?php echo get_comments_number()?></thr:total>
     87    <?php endif; ?>
    8588    </entry>
    8689    <?php endwhile ; ?>
Note: See TracChangeset for help on using the changeset viewer.