mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
891662aaed
commit
6dd7765ae1
@ -21,7 +21,7 @@ while( have_posts()) : the_post();
|
||||
|
||||
<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) { ?>
|
||||
<p><?php _e("The <abbr title=\"Universal Resource Locator\">URL</abbr> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>
|
||||
|
@ -21,7 +21,7 @@ while ( have_posts()) : the_post();
|
||||
|
||||
<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) { ?>
|
||||
<p>The <abbr title="Universal Resource Locator">URL</abbr> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>
|
||||
|
@ -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 "<a href='$url'>$link_text</a>";
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user