Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.x
Description: 

hook_comment_publish() and hook_comment_unpublish() have been removed in Drupal 8.x.

You can react to an update that changes the published status of a comment by using hook_entity_update(), hook_entity_insert(), or better yet hook_ENTITY_TYPE_update() and hook_ENTITY_TYPE_insert().

The update hooks will have $entity->original set to the original entity, before the changes.

Example in Drupal 7:

function mymodule_comment_publish($comment) {
  // The comment has just been published. React accordingly.
}

function mymodule_comment_unpublish($comment) {
  // The comment has just been unpublished. React accordingly.
}

Drupal 8:

function mymodule_comment_update($comment) {
  if ($comment->isPublished() && !$comment->original->isPublished()) {
     // The comment has just been published for the first time. React accordingly.
  }
  elseif (!$comment->isPublished() && $comment->original->isPublished()) {
     // The comment has just been unpublished for the first time. React accordingly.
  }
}

function mymodule_comment_insert($comment) {
  if ($comment->isPublished()) {
     // A new published comment has just been created. React accordingly.
  }
  else {
    // A new unpublished comment has just been created. React accordingly.
  }
}
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done