You are here

function paragraphs_library_update_8101 in Paragraphs 8

Enable "Usage" tab on library items.

File

modules/paragraphs_library/paragraphs_library.install, line 345
Install/Update hooks for paragraphs library.

Code

function paragraphs_library_update_8101() {
  $entity_usage_config = \Drupal::configFactory()
    ->getEditable('entity_usage.settings');
  $tabs_enabled = $entity_usage_config
    ->get('local_task_enabled_entity_types');
  if (is_array($tabs_enabled) && !in_array('paragraphs_library_item', $tabs_enabled)) {
    $tabs_enabled[] = 'paragraphs_library_item';
    $entity_usage_config
      ->set('local_task_enabled_entity_types', $tabs_enabled)
      ->save();
  }
}