1 field.info.inc | field_info_formatter_types($formatter_type = NULL) |
Returns information about field formatters from hook_field_formatter_info().
Parameters
$formatter_type: (optional) A formatter type name. If omitted, all formatter types will be returned.
Return value
Either a single formatter type description, as provided by: hook_field_formatter_info(), or an array of all existing formatter types, keyed by formatter type name.
Related topics
File
- core/
modules/ field/ field.info.inc, line 553 - Field Info API, providing information about available fields and field types.
Code
function field_info_formatter_types($formatter_type = NULL) {
$info = _field_info_collate_types();
$formatter_types = $info['formatter types'];
if ($formatter_type) {
if (isset($formatter_types[$formatter_type])) {
return $formatter_types[$formatter_type];
}
}
else {
return $formatter_types;
}
}