From 6dd7765ae19a06ee7d957112d379f20c58492fff Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 23 Feb 2007 08:31:07 +0000 Subject: [PATCH] Add get_post_comments_feed_link() and have popup comments templates use it. git-svn-id: http://svn.automattic.com/wordpress/trunk@4929 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/classic/comments-popup.php | 2 +- wp-content/themes/default/comments-popup.php | 2 +- wp-includes/feed.php | 15 ++++----------- wp-includes/link-template.php | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/wp-content/themes/classic/comments-popup.php b/wp-content/themes/classic/comments-popup.php index 8c0ba251e..bded9b406 100644 --- a/wp-content/themes/classic/comments-popup.php +++ b/wp-content/themes/classic/comments-popup.php @@ -21,7 +21,7 @@ while( have_posts()) : the_post();

-

RSS feed for comments on this post."); ?>

+

RSS feed for comments on this post."); ?>

ping_status) { ?>

URL to TrackBack this entry is:"); ?>

diff --git a/wp-content/themes/default/comments-popup.php b/wp-content/themes/default/comments-popup.php index 04dba338f..9ad28b5e0 100644 --- a/wp-content/themes/default/comments-popup.php +++ b/wp-content/themes/default/comments-popup.php @@ -21,7 +21,7 @@ while ( have_posts()) : the_post();

Comments

-

RSS feed for comments on this post.

+

RSS feed for comments on this post.

ping_status) { ?>

The URL to TrackBack this entry is:

diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 04f54d9a8..abee911e4 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -89,21 +89,14 @@ function comment_text_rss() { } -function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '') { - $url = comments_rss($commentsrssfilename); +function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused') { + $url = get_post_comments_feed_link();; echo "$link_text"; } -function comments_rss($commentsrssfilename = '') { - global $id; - - if ( '' != get_option('permalink_structure') ) - $url = trailingslashit( get_permalink() ) . user_trailingslashit('feed'); - else - $url = get_option('home') . "/$commentsrssfilename?feed=rss2&p=$id"; - - return apply_filters('post_comments_feed_link', $url); +function comments_rss($commentsrssfilename = 'nolongerused') { + return get_post_comments_feed_link(); } diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index f576129f8..1f600ee71 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -247,6 +247,24 @@ function get_feed_link($feed='rss2') { return apply_filters('feed_link', $output, $feed); } +function get_post_comments_feed_link($post_id = '', $feed = 'rss2') { + global $id; + + if ( empty($post_id) ) + $post_id = $id; + + if ( '' != get_option('permalink_structure') ) { + $url = trailingslashit( get_permalink() ) . 'feed'; + if ( 'rss2' != $feed ) + $url .= "/$feed"; + $url = user_trailingslashit($url); + } else { + $url = get_option('home') . "/?feed=$feed&p=$id"; + } + + return apply_filters('post_comments_feed_link', $url); +} + function edit_post_link($link = 'Edit This', $before = '', $after = '') { global $post;