Manual:Hooks/PrefixSearchExtractNamespace

PrefixSearchExtractNamespace
Available from version 1.25.0 (Gerrit change 168167)
Called if core was not able to extract a namespace from the search string so that extensions can attempt it.
Define function:
public static function onPrefixSearchExtractNamespace( &$namespaces, &$search ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"PrefixSearchExtractNamespace": "MediaWiki\\Extension\\MyExtension\\Hooks::onPrefixSearchExtractNamespace"
	}
}
Called from: File(s): search/PrefixSearch.php, search/SearchEngine.php
Interface: PrefixSearchExtractNamespaceHook.php

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


Details

edit
  • &$namespaces: array of int namespace keys to search in (change this if you can extract namespaces)
  • &$search: search term (replace this with term without the namespace if you can extract one)