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:
parent
200f0b020f
commit
f65528ed41
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue