You are here

function taxonomy_breadcrumb_taxonomy_term_update in Taxonomy Breadcrumb 8

Same name and namespace in other branches
  1. 7 taxonomy_breadcrumb.module \taxonomy_breadcrumb_taxonomy_term_update()

Implements hook_ENTITY_TYPE_update().

File

./taxonomy_breadcrumb.module, line 117
Generates taxonomy based breadcrumbs on node pages and taxonomy/term pages.

Code

function taxonomy_breadcrumb_taxonomy_term_update(EntityInterface $entity) {
  $bundle = $entity
    ->bundle();
  if (!FieldConfig::loadByName('taxonomy_term', $bundle, 'taxonomy_breadcrumb_path')) {
    FieldConfig::create(array(
      'field_name' => 'taxonomy_breadcrumb_path',
      'entity_type' => 'taxonomy_term',
      'bundle' => $bundle,
      'label' => t('Breadcrumb path (taxonomy_breadcrumb)'),
      'description' => t('The image of this term.'),
      'required' => FALSE,
    ))
      ->save();
  }
}