mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-08 06:34:34 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@35506 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -83,7 +83,9 @@ do_action( 'rss_tag_pre', 'rss2' );
|
||||
<item>
|
||||
<title><?php the_title_rss() ?></title>
|
||||
<link><?php the_permalink_rss() ?></link>
|
||||
<?php if ( get_comments_number() || comments_open() ) : ?>
|
||||
<comments><?php comments_link_feed(); ?></comments>
|
||||
<?php endif; ?>
|
||||
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
|
||||
<dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
|
||||
<?php the_category_rss('rss2') ?>
|
||||
@@ -100,8 +102,10 @@ do_action( 'rss_tag_pre', 'rss2' );
|
||||
<content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ( get_comments_number() || comments_open() ) : ?>
|
||||
<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
|
||||
<slash:comments><?php echo get_comments_number(); ?></slash:comments>
|
||||
<?php endif; ?>
|
||||
<?php rss_enclosure(); ?>
|
||||
<?php
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user