diff options
Diffstat (limited to 'wp-includes/feed-atom-comments.php')
| -rw-r--r-- | wp-includes/feed-atom-comments.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php index ee9a73b..e7c3c7c 100644 --- a/wp-includes/feed-atom-comments.php +++ b/wp-includes/feed-atom-comments.php @@ -1,4 +1,10 @@ <?php +/** + * Atom Feed Template for displaying Atom Comments feed. + * + * @package WordPress + */ + header('Content-Type: application/atom+xml; charset=' . get_option('blog_charset'), true); echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'; ?> @@ -11,18 +17,28 @@ echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>' if ( is_singular() ) printf(__('Comments on: %s'), get_the_title_rss()); elseif ( is_search() ) - printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); + printf(__('Comments for %1$s searching on %2$s'), get_bloginfo_rss( 'name' ), attribute_escape(get_search_query())); else printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); ?></title> <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle> <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated> - <generator uri="http://wordpress.org/" version="<?php bloginfo('version'); ?>">WordPress</generator> + <?php the_generator( 'atom' ); ?> +<?php if ( is_singular() ) { ?> + <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_comments_link(); ?>" /> + <link rel="self" type="application/atom+xml" href="<?php echo get_post_comments_feed_link('', 'atom'); ?>" /> + <id><?php echo get_post_comments_feed_link('', 'atom'); ?></id> +<?php } elseif(is_search()) { ?> + <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_option('home') . '?s=' . attribute_escape(get_search_query()); ?>" /> + <link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" /> + <id><?php echo get_search_comments_feed_link('', 'atom'); ?></id> +<?php } else { ?> <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>" /> <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" /> <id><?php bloginfo_rss('comments_atom_url'); ?></id> +<?php } ?> <?php if ( have_comments() ) : while ( have_comments() ) : the_comment(); |
