Add atom:self link to rss2 feeds per RSS Best Practices Profile. Fixes #5205 props lexhair and rubys.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2007-10-20 10:35:44 +00:00
parent fbd325f037
commit c75ec2b48a
2 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title><?php
@ -16,6 +17,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
else
printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
?></title>
<atom:link href="<?php bloginfo('comments_rss2_url') ?>" rel="self" type="application/rss+xml" />
<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
<description><?php bloginfo_rss("description") ?></description>
<pubDate><?php echo gmdate('r'); ?></pubDate>

View File

@ -9,11 +9,13 @@ $more = 1;
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
<?php do_action('rss2_ns'); ?>
>
<channel>
<title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
<atom:link href="<?php bloginfo('rss2_url') ?>" rel="self" type="application/rss+xml" />
<link><?php bloginfo_rss('url') ?></link>
<description><?php bloginfo_rss("description") ?></description>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>