Fix get_post_comments_feed_link() to work with pages. fixes #4637
git-svn-id: https://develop.svn.wordpress.org/trunk@5919 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e77ed87b6c
commit
84df0a2453
|
@ -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