function entity_test_entity_extra_field_info

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_entity_extra_field_info()
  2. 8.9.x core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_entity_extra_field_info()
  3. 10 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_entity_extra_field_info()

Implements hook_entity_extra_field_info().

File

core/modules/system/tests/modules/entity_test/entity_test.module, line 309

Code

function entity_test_entity_extra_field_info() {
    $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.