Manual:Hooks/InterwikiLoadPrefix
This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version 1.36.0. Please see $wgInterwikiCache for an alternative way to use this feature. |
InterwikiLoadPrefix | |
---|---|
Available from version 1.18.0 (r84173, codereview) This hook is called when resolving whether a given prefix is an interwiki or not. | |
Define function: | public static function onInterwikiLoadPrefix( $prefix, &$interwikiData ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"InterwikiLoadPrefix": "MediaWiki\\Extension\\MyExtension\\Hooks::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.
Parameters
editReturn true without providing an interwiki to continue interwiki search, or false to abort.
$prefix
: interwiki prefix we are looking for&$interwikiData
: output array describing the interwiki with keys interwiki.iw_url, interwiki.iw_local, interwiki.iw_trans and optionally interwiki.iw_api and interwiki.iw_wikiid.
This hook is not called when $wgInterwikiCache is used.
Notes
edit- This does not support enumerating all valid prefixes.