Alters the settings used for displaying an entity form.
\Drupal\entity\Plugin\Core\Entity\EntityFormDisplay $form_display: The entity_form_display object that will be used to display the entity form components.
array $context: An associative array containing:
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_entity_form_display_alter(\Drupal\entity\Plugin\Core\Entity\EntityFormDisplay $form_display, array $context) {
// Hide the 'user_picture' field from the register form.
if ($context['entity_type'] == 'user' && $context['form_mode'] == 'register') {
$form_display
->setComponent('user_picture', array(
'type' => 'hidden',
));
}
}