You are here

function field_count_formatter_field_formatter_info_alter in Field Count Formatter 8

Same name and namespace in other branches
  1. 2.x field_count_formatter.module \field_count_formatter_field_formatter_info_alter()

Implements hook_field_formatter_info_alter().

File

./field_count_formatter.module, line 12
Adds all fields to the field types (the plugin definition does not allow this).

Code

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);
  }
}