field_count_formatter.module in Field Count Formatter 8
Same filename and directory in other branches
Adds all fields to the field types (the plugin definition does not allow this).
File
field_count_formatter.moduleView source
<?php
/**
* @file
* Adds all fields to the field types (the plugin definition does not
* allow this).
*/
/**
* Implements hook_field_formatter_info_alter().
*/
function field_count_formatter_field_formatter_info_alter(array &$info) {
if (isset($info['count'])) {
$field_types = Drupal::service('plugin.manager.field.field_type')
->getDefinitions();
$info['count']['field_types'] = array_keys($field_types);
}
}
Functions
Name | Description |
---|---|
field_count_formatter_field_formatter_info_alter | Implements hook_field_formatter_info_alter(). |