WordPress.org

Make WordPress Core

Changeset 10385


Ignore:
Timestamp:
01/20/09 20:55:03 (5 years ago)
Author:
ryan
Message:

Use guid instead of link for atom comment IDs. fixes #8708 for trunk

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r10341 r10385  
    463463        $args['per_page'] = get_option('comments_per_page'); 
    464464 
    465     if ( empty($args['per_page']) ) { 
     465    if ( empty($args['per_page']) || is_feed() ) { 
    466466        $args['per_page'] = 0; 
    467467        $args['page'] = 0; 
  • trunk/wp-includes/feed-atom-comments.php

    r10377 r10385  
    6565        </author> 
    6666 
    67         <id><?php comment_link(); ?></id> 
     67        <id><?php comment_guid(); ?></id> 
    6868        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated> 
    6969        <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published> 
     
    8080    // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, its more important that they both use the same system 
    8181?> 
    82         <thr:in-reply-to ref="<?php echo get_comment_link($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" /> 
     82        <thr:in-reply-to ref="<?php comment_guid($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" /> 
    8383<?php endif; 
    8484    do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); 
  • trunk/wp-includes/feed.php

    r10377 r10385  
    224224 * @subpackage Feed 
    225225 * @since unknown 
    226  */ 
    227 function comment_guid() { 
    228     echo get_comment_guid(); 
     226 * 
     227 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. 
     228 */ 
     229function comment_guid($comment_id = null) { 
     230    echo get_comment_guid($comment_id); 
    229231} 
    230232 
     
    236238 * @since unknown 
    237239 * 
     240 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. 
    238241 * @return bool|string false on failure or guid for comment on success. 
    239242 */ 
    240 function get_comment_guid() { 
    241     global $comment; 
     243function get_comment_guid($comment_id = null) { 
     244    $comment = get_comment($comment_id); 
    242245 
    243246    if ( !is_object($comment) ) 
Note: See TracChangeset for help on using the changeset viewer.