From 84df0a2453f46a98530ea7a1ac4f61a722b26304 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 22 Aug 2007 22:42:57 +0000 Subject: [PATCH] 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 --- wp-includes/link-template.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9e71ac17d8..0b4c439897 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -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);