Use index.php for feed links instead of wp-*.php http://mosquito.wordpress.org/view.php?id=915
git-svn-id: http://svn.automattic.com/wordpress/trunk@2384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
98874495fb
commit
8d579218f6
|
@ -28,6 +28,9 @@ if ( is_single() || ($withcomments == 1) ) {
|
|||
case 'rss2':
|
||||
require('wp-rss2.php');
|
||||
break;
|
||||
case 'comments-rss2':
|
||||
require('wp-commentsrss2.php');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 "<a href='$url'>$link_text</a>";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue