You are here

function metatag_get_value in Metatag 7

Return the string value of a meta tag.

Parameters

string $metatag: The meta tag string.

array $data: The array of data for the meta tag class instance.

array $options: An optional array of additional options to pass to the getValue() method of the meta tag class instance.

  • raw: A boolean if TRUE will not perform token replacement.

Return value

string A string value.

2 calls to metatag_get_value()
metatag_config_overview in ./metatag.admin.inc
Menu callback for the main Metatag configuration page.
metatag_handler_field_serialized::replace_tokens in views/metatag_handler_field_serialized.inc

File

./metatag.module, line 2262
Primary hook implementations for Metatag.

Code

function metatag_get_value($metatag, array $data, array $options = array()) {
  $value = '';
  if ($metatag_instance = metatag_get_instance($metatag, $data)) {
    $options["instance"] = $metatag;
    $value = $metatag_instance
      ->getValue($options);
    if (is_array($value)) {
      $value = implode(', ', $value);
    }
  }
  return $value;
}