Available from version 1.18.0 (r94995)
Allows to modify fully-qualified URLs used for IRC and e-mail notifications.
Define function:
public static function onGetCanonicalURL( $title, &$url, $query ) { ... }
Attach hook: In extension.json:
	"Hooks": {
		"GetCanonicalURL": "MyExtensionHooks::onGetCanonicalURL"
Called from: File(s): Title.php
Interface: GetCanonicalURLHook.php

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


  • $title: Title object of page
  • $url: string value as output (out parameter, can modify)
  • $query: query options passed to Title::getCanonicalURL()