Manual:Hooks/SearchableNamespaces

From Linux Web Expert

SearchableNamespaces
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
An option to modify which namespaces are searchable.
<translate> Define function:</translate>
public static function onSearchableNamespaces( &$searchableNamespaces ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"SearchableNamespaces": "MediaWiki\\Extension\\MyExtension\\Hooks::onSearchableNamespaces"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> search/SearchEngine.php
<translate> Interface:</translate> SearchableNamespacesHook.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:SearchableNamespaces extensions</tvar>.</translate>


Details

  • &$searchableNamespaces: Array of namespaces ($nsId => $name) which will be used.