You are here

function _media_filter_fields_with_text_filtering in D7 Media 7

Returns an array containing the names of all fields that perform text filtering.

1 call to _media_filter_fields_with_text_filtering()
media_filter_parse_from_fields in includes/media.filter.inc
Parse file references from an entity's text fields and return them as an array.

File

includes/media.filter.inc, line 138
Functions related to the WYSIWYG editor and the media input filter.

Code

function _media_filter_fields_with_text_filtering($entity_type, $entity) {
  list($entity_id, $revision_id, $bundle) = entity_extract_ids($entity_type, $entity);
  $fields = field_info_instances($entity_type, $bundle);

  // Get all of the fields on this entity that allow text filtering.
  $fields_with_text_filtering = array();
  foreach ($fields as $field_name => $field) {
    if (!empty($field['settings']['text_processing'])) {
      $fields_with_text_filtering[] = $field_name;
    }
  }
  return $fields_with_text_filtering;
}