Manual:Hooks/InterwikiLoadPrefix
Deprecated: This feature is deprecated and should no longer be used, however it is still available for reasons of backwards compatibility .
|
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.