Changeset 4929

Show
Ignore:
Timestamp:
02/23/07 08:31:07 (2 years ago)
Author:
ryan
Message:

Add get_post_comments_feed_link() and have popup comments templates use it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-content/themes/classic/comments-popup.php

    r4890 r4929  
    2222<h2 id="comments"><?php _e("Comments"); ?></h2> 
    2323 
    24 <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> 
     24<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> 
    2525 
    2626<?php if ('open' == $post->ping_status) { ?> 
  • trunk/wp-content/themes/default/comments-popup.php

    r4890 r4929  
    2222<h2 id="comments">Comments</h2> 
    2323 
    24 <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> 
     24<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> 
    2525 
    2626<?php if ('open' == $post->ping_status) { ?> 
  • trunk/wp-includes/feed.php

    r4886 r4929  
    9090 
    9191 
    92 function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '') { 
    93     $url = comments_rss($commentsrssfilename)
     92function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused') { 
     93    $url = get_post_comments_feed_link();
    9494    echo "<a href='$url'>$link_text</a>"; 
    9595} 
    9696 
    9797 
    98 function comments_rss($commentsrssfilename = '') { 
    99     global $id; 
    100  
    101     if ( '' != get_option('permalink_structure') ) 
    102         $url = trailingslashit( get_permalink() ) . user_trailingslashit('feed'); 
    103     else 
    104         $url = get_option('home') . "/$commentsrssfilename?feed=rss2&amp;p=$id"; 
    105  
    106     return apply_filters('post_comments_feed_link', $url); 
     98function comments_rss($commentsrssfilename = 'nolongerused') { 
     99    return get_post_comments_feed_link(); 
    107100} 
    108101 
  • trunk/wp-includes/link-template.php

    r4886 r4929  
    248248} 
    249249 
     250function get_post_comments_feed_link($post_id = '', $feed = 'rss2') { 
     251    global $id; 
     252 
     253    if ( empty($post_id) ) 
     254        $post_id = $id; 
     255 
     256    if ( '' != get_option('permalink_structure') ) { 
     257        $url = trailingslashit( get_permalink() ) . 'feed'; 
     258        if ( 'rss2' != $feed ) 
     259            $url .= "/$feed"; 
     260        $url = user_trailingslashit($url); 
     261    } else { 
     262        $url = get_option('home') . "/?feed=$feed&amp;p=$id"; 
     263    } 
     264 
     265    return apply_filters('post_comments_feed_link', $url);   
     266} 
     267 
    250268function edit_post_link($link = 'Edit This', $before = '', $after = '') { 
    251269    global $post;