wxt-8.x-3.011/modules/custom/wxt_ext/wxt_ext_metatag/wxt_ext_metatag.module
modules/custom/wxt_ext/wxt_ext_metatag/wxt_ext_metatag.module
<?php
/**
* @file
* Contains wxt_ext_metatag.module.
*/
/**
* Implements hook_metatags_attachments_alter().
*/
function wxt_ext_metatag_metatags_attachments_alter(array &$metatag_attachments) {
foreach ($metatag_attachments['#attached']['html_head'] as &$tag) {
switch ($tag[1]) {
case 'dcterms_issued':
$tag[0]['#attributes']['title'] = 'W3CDTF';
break;
case 'dcterms_modified':
$tag[0]['#attributes']['title'] = 'W3CDTF';
break;
case 'dcterms_subject':
$tag[0]['#attributes']['title'] = 'gccore';
break;
case 'dcterms_language':
$tag[0]['#attributes']['title'] = 'ISO639-2/T';
// Need language code in ISO 639-2 format.
$content = $tag[0]['#attributes']['content'];
if ($content == 'en') {
$tag[0]['#attributes']['content'] = 'eng';
}
elseif ($content == 'fr') {
$tag[0]['#attributes']['content'] = 'fra';
}
break;
}
}
}
