comment_row_actions
Filters the action links displayed for each comment in the Comments list table.
Использование
add_filter( 'comment_row_actions', 'wp_kama_comment_row_actions_filter', 10, 2 ); /** * Function for `comment_row_actions` filter-hook. * * @param string[] $actions An array of comment actions. * @param WP_Comment $comment The comment object. * * @return string[] */ function wp_kama_comment_row_actions_filter( $actions, $comment ){ // filter... return $actions; }
- $actions(string[])
- An array of comment actions.
По умолчанию: actions include: 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam', 'Delete', and 'Trash' - $comment(WP_Comment)
- The comment object.
Список изменений
С версии 2.6.0 | Введена. |
Где вызывается хук
comment_row_actions
comment_row_actions
wp-admin/includes/class-wp-comments-list-table.php 860
$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
wp-admin/includes/dashboard.php 806
$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );