Manual:Hooks/SearchableNamespaces

From Linux Web Expert

Revision as of 14:56, 27 February 2021 by imported>Baris6161TURK
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.