You are here

function shariff_field_prepare_view in Shariff Social Media Buttons 7

Implements hook_field_prepare_view().

Adds a dummy value to the field to make rendering possible if the field is empty.

File

./shariff.module, line 510
Integrating Shariff library, providing settings form and block.

Code

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