I'm trying to add a custom meta tag description for a custom module using the metatag module.
I tried this without success:
function mycustommodule_metatag_metatags_view_alter(&$output, $instance) {
if ($instance == 'mycustom:entity') {
$output['description']['#attached']['drupal_add_html_head'][0] = array(
array(
'#tag' => 'meta',
'#name' => 'desription',
'#value' => $my_custom_description,
),
'description',
);
}
}