diff --git a/wp-feed.php b/wp-feed.php index 881b1772d..50bac02bc 100644 --- a/wp-feed.php +++ b/wp-feed.php @@ -28,6 +28,9 @@ if ( is_single() || ($withcomments == 1) ) { case 'rss2': require('wp-rss2.php'); break; + case 'comments-rss2': + require('wp-commentsrss2.php'); + break; } } diff --git a/wp-includes/feed-functions.php b/wp-includes/feed-functions.php index 1ec832990..3793fe9c2 100644 --- a/wp-includes/feed-functions.php +++ b/wp-includes/feed-functions.php @@ -73,20 +73,20 @@ function comment_text_rss() { echo $comment_text; } -function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'wp-commentsrss2.php') { +function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '') { $url = comments_rss($commentsrssfilename); echo "$link_text"; } -function comments_rss($commentsrssfilename = 'wp-commentsrss2.php') { +function comments_rss($commentsrssfilename = '') { global $id; if ('' != get_settings('permalink_structure')) $url = trailingslashit( get_permalink() ) . 'feed/'; else - $url = get_settings('siteurl') . "/$commentsrssfilename?p=$id"; + $url = get_settings('home') . "/$commentsrssfilename?feed=rss2&p=$id"; - return $url; + return apply_filters('post_comments_feed_link', $url); } function get_author_rss_link($echo = false, $author_id, $author_nicename) { @@ -94,12 +94,13 @@ function get_author_rss_link($echo = false, $author_id, $author_nicename) { $permalink_structure = get_settings('permalink_structure'); if ('' == $permalink_structure) { - $file = get_settings('siteurl') . '/wp-rss2.php'; - $link = $file . '?author=' . $author_id; + $link = get_settings('home') . '?feed=rss2&author=' . $author_id; } else { - $link = get_author_link(0, $author_id, $author_nicename); - $link = $link . "feed/"; + $link = get_author_link(0, $author_id, $author_nicename); + $link = $link . "feed/"; } + + $link = apply_filters('author_feed_link', $link); if ($echo) echo $link; return $link; @@ -110,13 +111,14 @@ function get_category_rss_link($echo = false, $category_id, $category_nicename) $permalink_structure = get_settings('permalink_structure'); if ('' == $permalink_structure) { - $file = get_settings('siteurl') . '/wp-rss2.php'; - $link = $file . '?cat=' . $category_id; + $link = get_settings('home') . '?feed=rss2&cat=' . $category_id; } else { - $link = get_category_link($category_id); - $link = $link . "feed/"; + $link = get_category_link($category_id); + $link = $link . "feed/"; } + $link = apply_filters('category_feed_link', $link); + if ($echo) echo $link; return $link; } diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index e547cda1f..d9e5f7a06 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -168,9 +168,9 @@ function get_feed_link($feed='rss2') { $output = get_settings('home') . $permalink; } else { if ( false !== strpos($feed, 'comments_') ) - $feed = str_replace('comments_', 'comments', $feed); + $feed = str_replace('comments_', 'comments-', $feed); - $output = get_settings('siteurl') . "/wp-{$feed}.php"; + $output = get_settings('home') . "/?feed={$feed}"; } return apply_filters('feed_link', $output, $feed);