If you are using the branch 6.x-2, you need to implement hook_nodewords_tags_info_alter()
to alter the weight index contained in the array returned by the implementations of hook_nodewords_tags_info()
.
The weight is used by _nodewords_output_tags()
, which is the function that renders the HTML output for the meta tags. Once the function has built the array of HTML strings to output, it sorts the array using the following code:
if (count($output)) {
array_multisort($weights, $output);
return implode("\n", $output);
}
else {
return '';
}
$weights
is the array containing the weight of every output meta tag.
I don't see any reason to change the weight of a meta tag, if not in a specific case where a meta tag consumer looks for two meta tags, and uses the first one that finds. Without a specific and valid reason, changing the weight of meta tags is useless, as meta tag consumers don't normally depend from the order meta tags are present in the HTML output.
_nodewords_output_tags()
is called after the implementations of hook_nodewords_tags_alter()
; altering the order of the array items in hook_nodewords_tags_alter()
doesn't then have any effect.
nodewords_load_all_includes('nodewords.hooks.inc');
drupal_alter('nodewords_tags', $output_tags, $options);
$output = _nodewords_output_tags($output_tags);
drupal_alter('nodewords_tags_output', $output, $options);