Manual:Hooks/SearchEngineReplacePrefixesComplete

From MediaWiki.org
Jump to: navigation, search
SearchEngineReplacePrefixesComplete
Available from version 1.16.0
Removed in version 1.24.0
Run after SearchEngine::replacePrefixes().
Define function:
public static function onSearchEngineReplacePrefixesComplete( $searchEngine, $query, &$parsed ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SearchEngineReplacePrefixesComplete": [
			"MyExtensionHooks::onSearchEngineReplacePrefixesComplete"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['SearchEngineReplacePrefixesComplete'][] = 'MyExtensionHooks::onSearchEngineReplacePrefixesComplete';
Called from: File(s): SearchEngine.php

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

Details[edit]

  • $searchEngine : The SearchEngine object. Users of this hooks will be interested in the $searchEngine->namespaces array.
  • $query : Original query.
  • &$parsed : Resultant query with the prefixes stripped.