You are here

function addthis_field_prepare_view in AddThis 7.4

Implements hook_field_prepare_view().

Adds a dummy value in AddThis field for nodes that do not have any value for the field to make rendering possible.

File

includes/addthis.field.inc, line 94
Field related hook implementations for the AddThis-module.

Code

function addthis_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
  foreach ($items as $key => $item) {
    if (!isset($item[0]['value'])) {
      $items[$key][0]['value'] = 'Dummy value';
    }
  }
}