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
This commit is contained in:
ryan 2007-02-23 08:31:07 +00:00
parent 891662aaed
commit 6dd7765ae1
4 changed files with 24 additions and 13 deletions

View File

@ -21,7 +21,7 @@ while( have_posts()) : the_post();
<h2 id="comments"><?php _e("Comments"); ?></h2> <h2 id="comments"><?php _e("Comments"); ?></h2>
<p><a href="<?php echo get_option('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><?php _e("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post."); ?></a></p> <p><a href="<?php echo get_post_comments_feed_link($post->ID); ?>"><?php _e("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post."); ?></a></p>
<?php if ('open' == $post->ping_status) { ?> <?php if ('open' == $post->ping_status) { ?>
<p><?php _e("The <abbr title=\"Universal Resource Locator\">URL</abbr> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p> <p><?php _e("The <abbr title=\"Universal Resource Locator\">URL</abbr> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>

View File

@ -21,7 +21,7 @@ while ( have_posts()) : the_post();
<h2 id="comments">Comments</h2> <h2 id="comments">Comments</h2>
<p><a href="<?php echo get_option('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.</a></p> <p><a href="<?php echo get_post_comments_feed_link($post->ID); ?>"><abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.</a></p>
<?php if ('open' == $post->ping_status) { ?> <?php if ('open' == $post->ping_status) { ?>
<p>The <abbr title="Universal Resource Locator">URL</abbr> to TrackBack this entry is: <em><?php trackback_url() ?></em></p> <p>The <abbr title="Universal Resource Locator">URL</abbr> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>

View File

@ -89,21 +89,14 @@ function comment_text_rss() {
} }
function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '') { function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused') {
$url = comments_rss($commentsrssfilename); $url = get_post_comments_feed_link();;
echo "<a href='$url'>$link_text</a>"; echo "<a href='$url'>$link_text</a>";
} }
function comments_rss($commentsrssfilename = '') { function comments_rss($commentsrssfilename = 'nolongerused') {
global $id; return get_post_comments_feed_link();
if ( '' != get_option('permalink_structure') )
$url = trailingslashit( get_permalink() ) . user_trailingslashit('feed');
else
$url = get_option('home') . "/$commentsrssfilename?feed=rss2&amp;p=$id";
return apply_filters('post_comments_feed_link', $url);
} }

View File

@ -247,6 +247,24 @@ function get_feed_link($feed='rss2') {
return apply_filters('feed_link', $output, $feed); 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&amp;p=$id";
}
return apply_filters('post_comments_feed_link', $url);
}
function edit_post_link($link = 'Edit This', $before = '', $after = '') { function edit_post_link($link = 'Edit This', $before = '', $after = '') {
global $post; global $post;