function ctools_fields_get_fields_by_type

cis7 fields.inc ctools_fields_get_fields_by_type($field_type)
cle7 fields.inc ctools_fields_get_fields_by_type($field_type)
elmsmedia7 fields.inc ctools_fields_get_fields_by_type($field_type)
icor7 fields.inc ctools_fields_get_fields_by_type($field_type)
meedjum_blog7 fields.inc ctools_fields_get_fields_by_type($field_type)
mooc7 fields.inc ctools_fields_get_fields_by_type($field_type)

Returns a list of field definitions of a specified type.

Parameters

string $field_type: A field type name; e.g. 'text' or 'date'.

Return value

array An array of field definitions of the specified type, keyed by field name.

File

sites/all/modules/ulmus/ctools/includes/fields.inc, line 302
Extend core fields with some helper functions to reduce code complexity within views and ctools plugins.

Code

function ctools_fields_get_fields_by_type($field_type) {
  $fields = array();
  foreach (field_info_fields() as $field_name => $field_info) {
    if ($field_info['type'] == $field_type) {
      $fields[$field_name] = $field_info;
    }
  }
  return $fields;
}