Action hook 'commentrss2_item'

in WP Core File wp-includes/feed-rss2-comments.php at line 119

View Source

commentrss2_item

Action Hook
Description
Fires at the end of each RSS2 comment feed item.

Hook Information

File Location wp-includes/feed-rss2-comments.php View on GitHub
Hook Type Action
Line Number 119

Hook Parameters

Type Name Description
int $comment_id The ID of the comment being displayed.
int $comment_post_id The ID of the post the comment is connected to.

Usage Examples

Basic Usage
<?php
// Hook into commentrss2_item
add_action('commentrss2_item', 'my_custom_function', 10, 2);

function my_custom_function($comment_id, $comment_post_id) {
    // Your custom code here
}

Source Code Context

wp-includes/feed-rss2-comments.php:119 - How this hook is used in WordPress core
<?php
 114  		 * @since 2.1.0
 115  		 *
 116  		 * @param int $comment_id      The ID of the comment being displayed.
 117  		 * @param int $comment_post_id The ID of the post the comment is connected to.
 118  		 */
 119  		do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
 120  		?>
 121  	</item>
 122  	<?php endwhile; ?>
 123  </channel>
 124  </rss>

PHP Documentation

<?php
/**
		 * Fires at the end of each RSS2 comment feed item.
		 *
		 * @since 2.1.0
		 *
		 * @param int $comment_id      The ID of the comment being displayed.
		 * @param int $comment_post_id The ID of the post the comment is connected to.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/feed-rss2-comments.php
Related Hooks

Related hooks will be displayed here in future updates.