allowed_formats_base_fields_test.module in Allowed Formats 8
Contains allowed_formats_base_fields_test.module.
File
tests/modules/allowed_formats_base_fields_test/allowed_formats_base_fields_test.moduleView source
<?php
/**
* @file
* Contains allowed_formats_base_fields_test.module.
*/
/**
* Implements hook_entity_base_field_info_alter().
*/
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',
]);
}
}
Functions
Name | Description |
---|---|
allowed_formats_base_fields_test_entity_base_field_info_alter | Implements hook_entity_base_field_info_alter(). |