You are here

function metatags_quick_field_insert in Meta tags quick 7.2

Implements hook_field_insert

See also

http://api.drupal.org/api/drupal/modules--field--field.api.php/function/...

1 call to metatags_quick_field_insert()
metatags_quick_field_update in ./metatags_quick.module
Implements hook_field_update

File

./metatags_quick.module, line 157
Quick and dirty implementation of meta tags for drupal 7 Module defines new field type 'meta'. Fields of this type are not displayed in HTML. Instead, they add html meta to the head section.

Code

function metatags_quick_field_insert($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {

  // Serialize array items - for the meta robots
  foreach ($items as $index => $item) {
    if (is_array($item['metatags_quick'])) {
      $non_empty = array();
      foreach ($item['metatags_quick'] as $subitem) {
        if ($subitem) {
          $non_empty[] = $subitem;
        }
      }
      $items[$index]['metatags_quick'] = join(',', $non_empty);
    }
  }
}