mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user