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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-01-20 20:55:03 +00:00
parent ab30688c26
commit ee73ce298c
3 changed files with 10 additions and 7 deletions

View File

@ -462,7 +462,7 @@ function get_comment_link( $comment = null, $args = array() ) {
if ( '' === $args['per_page'] && get_option('page_comments') )
$args['per_page'] = get_option('comments_per_page');
if ( empty($args['per_page']) ) {
if ( empty($args['per_page']) || is_feed() ) {
$args['per_page'] = 0;
$args['page'] = 0;
}

View File

@ -64,7 +64,7 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment();
</author>
<id><?php comment_link(); ?></id>
<id><?php comment_guid(); ?></id>
<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated>
<published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published>
<?php if ( post_password_required($comment_post) ) : ?>
@ -79,7 +79,7 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment();
$parent_comment = get_comment($comment->comment_parent);
// 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
?>
<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'); ?>" />
<thr:in-reply-to ref="<?php comment_guid($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />
<?php endif;
do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID);
?>

View File

@ -223,9 +223,11 @@ function the_permalink_rss() {
* @package WordPress
* @subpackage Feed
* @since unknown
*
* @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
*/
function comment_guid() {
echo get_comment_guid();
function comment_guid($comment_id = null) {
echo get_comment_guid($comment_id);
}
/**
@ -235,10 +237,11 @@ function comment_guid() {
* @subpackage Feed
* @since unknown
*
* @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
* @return bool|string false on failure or guid for comment on success.
*/
function get_comment_guid() {
global $comment;
function get_comment_guid($comment_id = null) {
$comment = get_comment($comment_id);
if ( !is_object($comment) )
return false;