function BlockContentThemeSuggestionsTestHooks::entityExtraFieldInfo

Implements hook_entity_extra_field_info().

Attributes

#[Hook('entity_extra_field_info')]

File

core/modules/block_content/tests/modules/block_content_theme_suggestions_test/src/Hook/BlockContentThemeSuggestionsTestHooks.php, line 22

Class

BlockContentThemeSuggestionsTestHooks
Hook implementations for block_content_theme_suggestions_test.

Namespace

Drupal\block_content_theme_suggestions_test\Hook

Code

public function entityExtraFieldInfo() : array {
  // Add an extra field to the test bundle.
  $extra['node']['bundle_with_extra_field']['display']['block_content_extra_field_test'] = [
    'label' => $this->t('Extra field'),
    'description' => $this->t('Extra field description'),
    'weight' => 0,
  ];
  return $extra;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.