Manual:Hooks/InterwikiLoadPrefix

InterwikiLoadPrefix
Available from version 1.18.0 (r84173)
When resolving if a given prefix is an interwiki or not.
Define function:
public static function onInterwikiLoadPrefix( $prefix, &$iwData ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"InterwikiLoadPrefix": "MyExtensionHooks::onInterwikiLoadPrefix"
	}
}
Called from:File(s): interwiki/Interwiki.php
Interface:InterwikiLoadPrefixHook.php

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

DetailsEdit

Return true without providing an interwiki to continue interwiki search.

  • $prefix: interwiki prefix we are looking for.
  • &$iwData: output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid.

This hook is not called when $wgInterwikiCache is used.