function hook_entity_extra_field_info_alter

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_extra_field_info_alter()
  2. 10 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_extra_field_info_alter()
  3. 11.x core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_extra_field_info_alter()

Alter "pseudo-field" components on content entities.

Parameters

array $info: The array structure is identical to that of the return value of \Drupal\Core\Entity\EntityFieldManagerInterface::getExtraFields().

See also

hook_entity_extra_field_info()

Related topics

1 function implements hook_entity_extra_field_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

field_test_entity_extra_field_info_alter in core/modules/field/tests/modules/field_test/field_test.module
Implements hook_entity_extra_field_info_alter().

File

core/lib/Drupal/Core/Entity/entity.api.php, line 2226

Code

function hook_entity_extra_field_info_alter(&$info) {
    // Force node title to always be at the top of the list by default.
    foreach (NodeType::loadMultiple() as $bundle) {
        if (isset($info['node'][$bundle->id()]['form']['title'])) {
            $info['node'][$bundle->id()]['form']['title']['weight'] = -20;
        }
    }
}

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