Fix get_post_comments_feed_link() to work with pages. fixes #4637

git-svn-id: http://svn.automattic.com/wordpress/trunk@5919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-08-22 22:42:57 +00:00
parent 200f0b020f
commit f65528ed41
1 changed files with 6 additions and 2 deletions

View File

@ -260,12 +260,16 @@ function get_post_comments_feed_link($post_id = '', $feed = 'rss2') {
$post_id = (int) $id;
if ( '' != get_option('permalink_structure') ) {
$url = trailingslashit( get_permalink() ) . 'feed';
$url = trailingslashit( get_permalink($post_id) ) . 'feed';
if ( 'rss2' != $feed )
$url .= "/$feed";
$url = user_trailingslashit($url, 'single_feed');
} else {
$url = get_option('home') . "/?feed=$feed&p=$id";
$type = get_post_field('post_type', $post_id);
if ( 'page' == $type )
$url = get_option('home') . "/?feed=$feed&page_id=$post_id";
else
$url = get_option('home') . "/?feed=$feed&p=$post_id";
}
return apply_filters('post_comments_feed_link', $url);