function allowed_formats_base_fields_test_entity_base_field_info_alter in Allowed Formats 8
Implements hook_entity_base_field_info_alter().
File
- tests/
modules/ allowed_formats_base_fields_test/ allowed_formats_base_fields_test.module, line 11 - Contains allowed_formats_base_fields_test.module.
Code
function allowed_formats_base_fields_test_entity_base_field_info_alter(&$fields, $entity_type) {
if ($entity_type
->id() == 'taxonomy_term') {
// Configure allowed format settings.
$fields['description']
->setSetting('allowed_formats', [
'basic_html' => 'basic_html',
'restricted_html' => 'restricted_html',
]);
}
}