You are here

function gathercontent_gathercontent_process_metatag_pane in GatherContent 7.3

Parameters

EntityMetadataWrapper $node: Object of node.

array $metatags: Array of metatags.

int $gathercontent_id: ID of item in GatherContent.

string $local_field_name: Name of local Drupal field.

object $field: Object of GatherContent field.

string $content_type: Name of Content type, we are mapping to.

bool $is_translatable: Indicator if node is translatable.

string $language: Language of translation if applicable.

Throws

\Exception

1 call to gathercontent_gathercontent_process_metatag_pane()
_gathercontent_fetcher in ./gathercontent.module
Helper function for fetching data from GatherContent.

File

./gathercontent.module, line 700

Code

function gathercontent_gathercontent_process_metatag_pane(EntityMetadataWrapper &$node, &$metatags, $gathercontent_id, $local_field_name, $field, $content_type, $is_translatable = FALSE, $language = LANGUAGE_NONE) {
  if (module_exists('metatag') && metatag_entity_supports_metatags('node', $content_type)) {
    $metatags[$language][$local_field_name] = array(
      'value' => $field->value,
    );
  }
  else {
    throw new Exception("Metatag module not enabled or entity doesn't support \n    metatags while trying to map values woth metatag content.");
  }
}