You are here

function profanity_entity_property_getter in Profanity 7

Get the label property for a passed entity filtered for profanity.

1 string reference to 'profanity_entity_property_getter'
profanity_entity_property_info_alter in ./profanity.module
Implements hook_entity_property_info_alter().

File

./profanity.module, line 613
Main {profanity} file.

Code

function profanity_entity_property_getter($data, array $options, $name, $type, $info) {
  $entity_info = entity_get_info($type);
  $title_property = $entity_info['entity keys']['label'];
  $text = $data->{$title_property};
  foreach (variable_get('profanity_supply_entity_properties_lists', array()) as $list_name) {
    $text = profanity_list_execute($list_name, $text);
  }
  return $text;
}