function admin_toolbar_tools_entity_delete in Admin Toolbar 8.2
Same name and namespace in other branches
- 3.x admin_toolbar_tools/admin_toolbar_tools.module \admin_toolbar_tools_entity_delete()
Implements hook_entity_delete().
File
- admin_toolbar_tools/
admin_toolbar_tools.module, line 78 - Provides extra menu links for the core drupal toolbar.
Code
function admin_toolbar_tools_entity_delete(EntityInterface $entity) {
$entities = \Drupal::service('admin_toolbar_tools.helper')
->getRebuildEntityTypes();
if (in_array($entity
->getEntityTypeId(), $entities)) {
\Drupal::service('plugin.manager.menu.link')
->rebuild();
}
}