hook_entity_extra_field_info_alter(&$info)
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\EntityManagerInterface::getExtraFields().
See also
hook_entity_extra_field_info()
Related topics
- Hooks
- Define functions that alter the behavior of Drupal core.
File
- core/lib/Drupal/Core/Entity/entity.api.php, line 2010
- Hooks and documentation related to entities.
Code
1 2 3 4 5 6 7 8 | 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; } } } |
Please login to continue.