Make WordPress Core

Changeset 9818


Ignore:
Timestamp:
11/20/2008 07:08:41 PM (16 years ago)
Author:
ryan
Message:

Add threaded comment info to atom feed. Props dtsn. fixes #8292

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/feed-atom-comments.php

    r6819 r9818  
    6767        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated>
    6868        <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published>
    69 <?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?>
     69<?php if ( post_password_required() ) : ?>
    7070        <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content>
    7171<?php else : // post pass ?>
    7272        <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content>
    7373<?php endif; // post pass
     74    // Return comment threading information (http://www.ietf.org/rfc/rfc4685.txt)
     75    if ( $comment->comment_parent == 0 ) : // This comment is top level ?>
     76        <thr:in-reply-to rel="<?php the_guid() ?>" href="<?php the_permalink_rss() ?>" type="<?php bloginfo_rss('html_type'); ?>" />
     77<?php else : // This comment is in reply to another comment
     78    $parent_comment = get_comment($comment->comment_parent);
     79    // 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
     80?>
     81        <thr:in-reply-to rel="<?php echo get_comment_link($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />
     82<?php endif;
    7483    do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID);
    7584?>
Note: See TracChangeset for help on using the changeset viewer.