You are here

function smart_title_entity_extra_field_info in Smart Title 8

Implements hook_entity_extra_field_info().

File

./smart_title.module, line 71
Contains hooks and private functions of smart_title.module.

Code

function smart_title_entity_extra_field_info() {
  $extra = [];
  $config = \Drupal::service('config.factory')
    ->get('smart_title.settings');
  $smartTitleConfig = $config
    ->get('smart_title') ?: [];
  foreach ($smartTitleConfig as $entityTypeAndBundle) {
    list($entityTypeId, $bundle) = explode(':', $entityTypeAndBundle);
    $extra[$entityTypeId][$bundle]['display']['smart_title'] = [
      'label' => t('Smart Title'),
      'weight' => -5,
      'visible' => FALSE,
    ];
  }
  return $extra;
}