W3cubDocs

/WordPress

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

Fires immediately before a comment is deleted from the database.

Parameters

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

Source

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

Changelog

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

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