Atom comments feed. First pass. Props kurtmckee and rob1n. fixes #1785

git-svn-id: https://develop.svn.wordpress.org/trunk@4928 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-02-23 08:18:30 +00:00
parent 9b6a6b632c
commit 6c6458f7c9
3 changed files with 112 additions and 8 deletions
+19 -8
View File
@@ -944,14 +944,21 @@ function do_feed() {
// Remove the pad, if present.
$feed = preg_replace('/^_+/', '', $feed);
if ($feed == '' || $feed == 'feed')
if ( $feed == '' || $feed == 'feed' )
$feed = 'rss2';
$for_comments = false;
if ( 1 != get_query_var('withoutcomments') && ( is_singular() || get_query_var('withcomments') == 1 || $feed == 'comments-rss2' ) ) {
$feed = 'rss2';
$for_comments = true;
}
if ( is_singular() || get_query_var('withcomments') == 1 )
$for_comments = true;
if ( false !== strpos($feed, 'comments-') ) {
$for_comments = true;
$feed = str_replace('comments-', '', $feed);
}
if ( get_query_var('withoutcomments') == 1 )
$for_comments = false;
$hook = 'do_feed_' . $feed;
do_action($hook, $for_comments);
@@ -973,8 +980,12 @@ function do_feed_rss2($for_comments) {
}
}
function do_feed_atom() {
load_template(ABSPATH . WPINC . '/feed-atom.php');
function do_feed_atom($for_comments) {
if ($for_comments) {
load_template(ABSPATH . WPINC . '/feed-atom-comments.php');
} else {
load_template(ABSPATH . WPINC . '/feed-atom.php');
}
}
function do_robots() {