function hook_metatag_metatags_view_alter in Metatag 7
Alter metatags before being cached.
This hook is invoked prior to the meta tags for a given page are cached.
Parameters
array $output: All of the meta tags to be output for this page in their render format. This is a heavily nested array.
string $instance: An identifier for the current page's page type, typically a combination of the entity name and bundle name, e.g. "node:story".
array $options: All of the options used to generate the meta tags.
1 function implements hook_metatag_metatags_view_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- metatag_hreflang_metatag_metatags_view_alter in metatag_hreflang/
metatag_hreflang.module - Implements hook_metatag_metatags_view_alter().
3 invocations of hook_metatag_metatags_view_alter()
- metatag_context_reaction::execute in metatag_context/
metatag_context.context.inc - Output a list of active contexts.
- metatag_metatags_view in ./
metatag.module - Build a renderable array of meta tag output.
- metatag_panels_ctools_render_alter in metatag_panels/
metatag_panels.module - Implements hook_ctools_render_alter().
File
- ./
metatag.api.php, line 313 - API documentation for the Metatag module.
Code
function hook_metatag_metatags_view_alter(array &$output, $instance, array $options) {
if (isset($output['description']['#attached']['drupal_add_html_head'][0][0]['#value'])) {
$output['description']['#attached']['drupal_add_html_head'][0][0]['#value'] = 'O rly?';
}
}