function nodewords_extra_dc_date_prepare in Nodewords: D6 Meta Tags 6
Same name and namespace in other branches
- 6.2 nodewords_extra/includes/nodewords_extra.nodewords.tags.inc \nodewords_extra_dc_date_prepare()
Set the meta tag content.
File
- nodewords_extra/
nodewords_extra.module, line 395 - Define extra meta tags for Drupal pages.
Code
function nodewords_extra_dc_date_prepare(&$tags, $content, $options) {
$time = 0;
if (!empty($content['value'])) {
$time = mktime(0, 0, 0, $content['value']['month'], $content['value']['day'], $content['value']['year']);
}
elseif (!empty($options['default']['dcterms.date']['value']['month'])) {
$time = mktime(0, 0, 0, $options['default']['dcterms.date']['value']['month'], $options['default']['dcterms.date']['value']['day'], $options['default']['dcterms.date']['value']['year']);
}
// If a time field was identified, use it.
if (!empty($time)) {
$tags['dcterms.date'] = date('Y-m-d\\TH:i:s\\Z', $time);
}
}