WordPress.org

Make WordPress Core

Ticket #9134: 9134-v2.patch

File 9134-v2.patch, 2.1 KB (added by peaceablewhale, 9 years ago)
  • feed-atom.php

     
    4747<?php endif; ?>
    4848<?php atom_enclosure(); ?>
    4949<?php do_action('atom_entry'); ?>
    50                 <link rel="replies" type="text/html" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
    51                 <link rel="replies" type="application/atom+xml" href="<?php echo get_post_comments_feed_link(0,'atom') ?>" thr:count="<?php echo get_comments_number()?>"/>
    52                 <thr:total><?php echo get_comments_number()?></thr:total>
     50<?php if(($comments_number=get_comments_number())>0||comments_open()===true):?>
     51                <link rel="replies" type="text/html" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo $comments_number;?>" />
     52                <link rel="replies" type="application/atom+xml" href="<?php echo get_post_comments_feed_link(0,'atom') ?>" thr:count="<?php echo $comments_number;?>" />
     53                <thr:total><?php echo $comments_number;?></thr:total>
     54<?php endif;?>
    5355        </entry>
    5456        <?php endwhile ; ?>
    5557</feed>
  • feed-rss2.php

     
    3535        <item>
    3636                <title><?php the_title_rss() ?></title>
    3737                <link><?php the_permalink_rss() ?></link>
    38                 <comments><?php comments_link(); ?></comments>
    3938                <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
    4039                <dc:creator><?php the_author() ?></dc:creator>
    4140                <?php the_category_rss() ?>
     
    5150                <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
    5251        <?php endif; ?>
    5352<?php endif; ?>
     53<?php if(get_comments_number()>0||comments_open()===true):?>
     54                <comments><?php comments_link(); ?></comments>
    5455                <wfw:commentRss><?php echo get_post_comments_feed_link(); ?></wfw:commentRss>
    5556                <slash:comments><?php echo get_comments_number(); ?></slash:comments>
     57<?php endif;?>
    5658<?php rss_enclosure(); ?>
    5759        <?php do_action('rss2_item'); ?>
    5860        </item>