Manual:Hooks/GetInternalURL

From Linux Web Expert

GetInternalURL
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Used to modify fully-qualified URLs (useful for squid cache purging)
<translate> Define function:</translate>
public static function onGetInternalURL( $title, $url, $query ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"GetInternalURL": "MediaWiki\\Extension\\MyExtension\\Hooks::onGetInternalURL"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> Title.php
<translate> Interface:</translate> GetInternalURLHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:GetInternalURL extensions</tvar>.</translate>

Details

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

See also