You are here

function comment_uninstall in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/comment/comment.install \comment_uninstall()
  2. 7 modules/comment/comment.install \comment_uninstall()
  3. 9 core/modules/comment/comment.install \comment_uninstall()

Implements hook_uninstall().

File

core/modules/comment/comment.install, line 14
Install, update and uninstall functions for the Comment module.

Code

function comment_uninstall() {

  // Remove the comment fields.
  $storage = \Drupal::entityTypeManager()
    ->getStorage('field_storage_config');
  $fields = $storage
    ->loadByProperties([
    'type' => 'comment',
  ]);
  $storage
    ->delete($fields);

  // Remove state setting.
  \Drupal::state()
    ->delete('comment.node_comment_statistics_scale');
}