Jump to content

Manual:Hooks/GetInternalURL

From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
GetInternalURL
Available from version 1.6.0
Used to modify fully-qualified URLs (useful for squid cache purging)
Define function:
public static function onGetInternalURL( $title, $url, $query ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"GetInternalURL": "MediaWiki\\Extension\\MyExtension\\Hooks::onGetInternalURL"
	}
}
Called from: File(s): Title/Title.php
Interface: GetInternalURLHook.php

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

Details

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

See also