Filter hook 'comment_row_actions'

in WP Core File wp-admin/includes/class-wp-comments-list-table.php at line 864

View Source

comment_row_actions

Filter Hook
Description
Filters the action links displayed for each comment in the Comments list table.

Hook Information

File Location wp-admin/includes/class-wp-comments-list-table.php View on GitHub
Hook Type Filter
Line Number 864

Hook Parameters

Type Name Description
string[] $actions An array of comment actions. Default actions include: 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam', 'Delete', and 'Trash'.
WP_Comment $comment The comment object.

Usage Examples

Basic Usage
<?php
// Hook into comment_row_actions
add_filter('comment_row_actions', 'my_custom_filter', 10, 2);

function my_custom_filter($actions, $comment) {
    // Your custom filtering logic here
    return $actions;
}

Source Code Context

wp-admin/includes/class-wp-comments-list-table.php:864 - How this hook is used in WordPress core
<?php
 859  		 * @param string[]   $actions An array of comment actions. Default actions include:
 860  		 *                            'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
 861  		 *                            'Delete', and 'Trash'.
 862  		 * @param WP_Comment $comment The comment object.
 863  		 */
 864  		$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
 865  
 866  		$always_visible = false;
 867  
 868  		$mode = get_user_setting( 'posts_list_mode', 'list' );
 869  

PHP Documentation

<?php
/**
		 * Filters the action links displayed for each comment in the Comments list table.
		 *
		 * @since 2.6.0
		 *
		 * @param string[]   $actions An array of comment actions. Default actions include:
		 *                            'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
		 *                            'Delete', and 'Trash'.
		 * @param WP_Comment $comment The comment object.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-comments-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.