function hook_comment_delete

The comment is being deleted by the moderator.

Parameters

$comment: Passes in the comment the action is being performed on.

Return value

Nothing.

Related topics

7 functions implement hook_comment_delete()

Note: the procedural functions in this list are found by pattern matching, so the list may include some functions that are not actually implementations of this hook.

EntityCrudHookTestHooks::commentDelete in core/modules/system/tests/modules/entity_crud_hook_test/src/Hook/EntityCrudHookTestHooks.php
Implements hook_ENTITY_TYPE_delete() for comment entities.
entity_crud_hook_test_comment_delete in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_comment_delete().
forum_comment_delete in modules/forum/forum.module
Implements hook_comment_delete().
NodeHooks1::commentDelete in core/modules/node/src/Hook/NodeHooks1.php
Implements hook_ENTITY_TYPE_delete() for comment entities.
search_comment_delete in modules/search/search.module
Implements hook_comment_delete().

... See full list

1 invocation of hook_comment_delete()
comment_delete_multiple in modules/comment/comment.module
Delete comments and all their replies.

File

modules/comment/comment.api.php, line 139

Code

function hook_comment_delete($comment) {
    drupal_set_message(t('Comment: @subject has been deleted', array(
        '@subject' => $comment->subject,
    )));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.