Edit File by line
/home/barbar84/www/wp-inclu...
File: feed-atom-comments.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Atom Feed Template for displaying Atom Comments feed.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
[7] Fix | Delete
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '" ?' . '>';
[8] Fix | Delete
[9] Fix | Delete
/** This action is documented in wp-includes/feed-rss2.php */
[10] Fix | Delete
do_action( 'rss_tag_pre', 'atom-comments' );
[11] Fix | Delete
?>
[12] Fix | Delete
<feed
[13] Fix | Delete
xmlns="http://www.w3.org/2005/Atom"
[14] Fix | Delete
xml:lang="<?php bloginfo_rss( 'language' ); ?>"
[15] Fix | Delete
xmlns:thr="http://purl.org/syndication/thread/1.0"
[16] Fix | Delete
<?php
[17] Fix | Delete
/** This action is documented in wp-includes/feed-atom.php */
[18] Fix | Delete
do_action( 'atom_ns' );
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Fires inside the feed tag in the Atom comment feed.
[22] Fix | Delete
*
[23] Fix | Delete
* @since 2.8.0
[24] Fix | Delete
*/
[25] Fix | Delete
do_action( 'atom_comments_ns' );
[26] Fix | Delete
?>
[27] Fix | Delete
>
[28] Fix | Delete
<title type="text">
[29] Fix | Delete
<?php
[30] Fix | Delete
if ( is_singular() ) {
[31] Fix | Delete
/* translators: Comments feed title. %s: Post title. */
[32] Fix | Delete
printf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() );
[33] Fix | Delete
} elseif ( is_search() ) {
[34] Fix | Delete
/* translators: Comments feed title. 1: Site title, 2: Search query. */
[35] Fix | Delete
printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
[36] Fix | Delete
} else {
[37] Fix | Delete
/* translators: Comments feed title. %s: Site title. */
[38] Fix | Delete
printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
[39] Fix | Delete
}
[40] Fix | Delete
?>
[41] Fix | Delete
</title>
[42] Fix | Delete
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
[43] Fix | Delete
[44] Fix | Delete
<updated><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?></updated>
[45] Fix | Delete
[46] Fix | Delete
<?php if ( is_singular() ) : ?>
[47] Fix | Delete
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php comments_link_feed(); ?>" />
[48] Fix | Delete
<link rel="self" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link( '', 'atom' ) ); ?>" />
[49] Fix | Delete
<id><?php echo esc_url( get_post_comments_feed_link( '', 'atom' ) ); ?></id>
[50] Fix | Delete
<?php elseif ( is_search() ) : ?>
[51] Fix | Delete
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php echo home_url() . '?s=' . get_search_query(); ?>" />
[52] Fix | Delete
<link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link( '', 'atom' ); ?>" />
[53] Fix | Delete
<id><?php echo get_search_comments_feed_link( '', 'atom' ); ?></id>
[54] Fix | Delete
<?php else : ?>
[55] Fix | Delete
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" />
[56] Fix | Delete
<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss( 'comments_atom_url' ); ?>" />
[57] Fix | Delete
<id><?php bloginfo_rss( 'comments_atom_url' ); ?></id>
[58] Fix | Delete
<?php endif; ?>
[59] Fix | Delete
<?php
[60] Fix | Delete
/**
[61] Fix | Delete
* Fires at the end of the Atom comment feed header.
[62] Fix | Delete
*
[63] Fix | Delete
* @since 2.8.0
[64] Fix | Delete
*/
[65] Fix | Delete
do_action( 'comments_atom_head' );
[66] Fix | Delete
?>
[67] Fix | Delete
<?php
[68] Fix | Delete
while ( have_comments() ) :
[69] Fix | Delete
the_comment();
[70] Fix | Delete
$comment_post = get_post( $comment->comment_post_ID );
[71] Fix | Delete
$GLOBALS['post'] = $comment_post;
[72] Fix | Delete
?>
[73] Fix | Delete
<entry>
[74] Fix | Delete
<title>
[75] Fix | Delete
<?php
[76] Fix | Delete
if ( ! is_singular() ) {
[77] Fix | Delete
$title = get_the_title( $comment_post->ID );
[78] Fix | Delete
/** This filter is documented in wp-includes/feed.php */
[79] Fix | Delete
$title = apply_filters( 'the_title_rss', $title );
[80] Fix | Delete
/* translators: Individual comment title. 1: Post title, 2: Comment author name. */
[81] Fix | Delete
printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() );
[82] Fix | Delete
} else {
[83] Fix | Delete
/* translators: Comment author title. %s: Comment author name. */
[84] Fix | Delete
printf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() );
[85] Fix | Delete
}
[86] Fix | Delete
?>
[87] Fix | Delete
</title>
[88] Fix | Delete
<link rel="alternate" href="<?php comment_link(); ?>" type="<?php bloginfo_rss( 'html_type' ); ?>" />
[89] Fix | Delete
[90] Fix | Delete
<author>
[91] Fix | Delete
<name><?php comment_author_rss(); ?></name>
[92] Fix | Delete
<?php
[93] Fix | Delete
if ( get_comment_author_url() ) {
[94] Fix | Delete
echo '<uri>' . get_comment_author_url() . '</uri>';}
[95] Fix | Delete
?>
[96] Fix | Delete
[97] Fix | Delete
</author>
[98] Fix | Delete
[99] Fix | Delete
<id><?php comment_guid(); ?></id>
[100] Fix | Delete
<updated><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></updated>
[101] Fix | Delete
<published><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', get_comment_time( 'Y-m-d H:i:s', true, false ), false ); ?></published>
[102] Fix | Delete
[103] Fix | Delete
<?php if ( post_password_required( $comment_post ) ) : ?>
[104] Fix | Delete
<content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content>
[105] Fix | Delete
<?php else : ?>
[106] Fix | Delete
<content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content>
[107] Fix | Delete
<?php endif; // End if post_password_required(). ?>
[108] Fix | Delete
[109] Fix | Delete
<?php
[110] Fix | Delete
// Return comment threading information (https://www.ietf.org/rfc/rfc4685.txt).
[111] Fix | Delete
if ( 0 == $comment->comment_parent ) : // This comment is top-level.
[112] Fix | Delete
?>
[113] Fix | Delete
<thr:in-reply-to ref="<?php the_guid(); ?>" href="<?php the_permalink_rss(); ?>" type="<?php bloginfo_rss( 'html_type' ); ?>" />
[114] Fix | Delete
<?php
[115] Fix | Delete
else : // This comment is in reply to another comment.
[116] Fix | Delete
$parent_comment = get_comment( $comment->comment_parent );
[117] Fix | Delete
/*
[118] Fix | Delete
* The rel attribute below and the id tag above should be GUIDs,
[119] Fix | Delete
* but WP doesn't create them for comments (unlike posts).
[120] Fix | Delete
* Either way, it's more important that they both use the same system.
[121] Fix | Delete
*/
[122] Fix | Delete
?>
[123] Fix | Delete
<thr:in-reply-to ref="<?php comment_guid( $parent_comment ); ?>" href="<?php echo get_comment_link( $parent_comment ); ?>" type="<?php bloginfo_rss( 'html_type' ); ?>" />
[124] Fix | Delete
<?php
[125] Fix | Delete
endif;
[126] Fix | Delete
[127] Fix | Delete
/**
[128] Fix | Delete
* Fires at the end of each Atom comment feed item.
[129] Fix | Delete
*
[130] Fix | Delete
* @since 2.2.0
[131] Fix | Delete
*
[132] Fix | Delete
* @param int $comment_id ID of the current comment.
[133] Fix | Delete
* @param int $comment_post_id ID of the post the current comment is connected to.
[134] Fix | Delete
*/
[135] Fix | Delete
do_action( 'comment_atom_entry', $comment->comment_ID, $comment_post->ID );
[136] Fix | Delete
?>
[137] Fix | Delete
</entry>
[138] Fix | Delete
<?php
[139] Fix | Delete
endwhile;
[140] Fix | Delete
?>
[141] Fix | Delete
</feed>
[142] Fix | Delete
[143] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function