W3cubDocs

/WordPress

do_action( ‘trash_comment’, string $comment_id, WP_Comment $comment )

Fires immediately before a comment is sent to the Trash.

Parameters

$comment_idstring
The comment ID as a numeric string.
$commentWP_Comment
The comment to be trashed.

Source

do_action( 'trash_comment', $comment->comment_ID, $comment );

Changelog

Version Description
4.9.0 Added the $comment parameter.
2.9.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/trash_comment