Manual:Hooks/InterwikiLoadPrefix

From Linux Web Expert

InterwikiLoadPrefix
<translate> Available from <tvar name=1><translate> version <tvar (r84173, codereview)</tvar></translate>
This hook is called when resolving whether a given prefix is an interwiki or not.
<translate> Define function:</translate>
public static function onInterwikiLoadPrefix( $prefix, &$interwikiData ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"InterwikiLoadPrefix": "MediaWiki\\Extension\\MyExtension\\Hooks::onInterwikiLoadPrefix"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> interwiki/Interwiki.php
<translate> Interface:</translate> InterwikiLoadPrefixHook.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:InterwikiLoadPrefix extensions</tvar>.</translate>


Parameters

Return true without providing an interwiki to continue interwiki search, or false to abort.

This hook is not called when $wgInterwikiCache is used.

Notes

  • This does not support enumerating all valid prefixes.