function EntityTestHooks::entityExtraFieldInfo
Implements hook_entity_extra_field_info().
File
-
core/
modules/ system/ tests/ modules/ entity_test/ src/ Hook/ EntityTestHooks.php, line 206
Class
- EntityTestHooks
- Hook implementations for entity_test.
Namespace
Drupal\entity_test\HookCode
public function entityExtraFieldInfo() {
$extra['entity_test']['bundle_with_extra_fields'] = [
'display' => [
// Note: those extra fields do not currently display anything, they are
// just used in \Drupal\Tests\field_ui\Kernel\EntityDisplayTest to test
// the behavior of entity display objects.
'display_extra_field' => [
'label' => t('Display extra field'),
'description' => t('An extra field on the display side.'),
'weight' => 5,
'visible' => TRUE,
],
'display_extra_field_hidden' => [
'label' => t('Display extra field (hidden)'),
'description' => t('An extra field on the display side, hidden by default.'),
'visible' => FALSE,
],
],
];
return $extra;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.