Manual:Hooks/OutputPageAfterGetHeadLinksArray

From mediawiki.org
Jump to navigation Jump to search
OutputPageAfterGetHeadLinksArray
Available from version 1.32.0 (Gerrit change 441631)
Allows extensions to modify the HTML metadata in the <head> element
Define function:
public static function onOutputPageAfterGetHeadLinksArray( $x, OutputPage $output ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"OutputPageAfterGetHeadLinksArray": "MyExtensionHooks::onOutputPageAfterGetHeadLinksArray"
	}
}
Called from:File(s): OutputPage.php
Function(s): getHeadLinksArray
Interface:OutputPageAfterGetHeadLinksArrayHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:OutputPageAfterGetHeadLinksArray extensions.

Details[edit]

  • &$tags: Associative array of all <link> elements generated so far
  • $output: the OutputPage object