Open main menu

Manual:Hooks/SpecialSearchNogomatch

SpecialSearchNogomatch
Available from version 1.6.0
Called when the 'Go' feature is triggered (generally from autocomplete search other than the main bar on Special:Search) and the target doesn't exist. Full text search results are generated after this hook is called.
Define function:
public static function onSpecialSearchNogomatch( &$title ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SpecialSearchNogomatch": "MyExtensionHooks::onSpecialSearchNogomatch"
	}
}

For MediaWiki ≤1.25:

$wgHooks['SpecialSearchNogomatch'][] = 'MyExtensionHooks::onSpecialSearchNogomatch';
Called from:File(s): SpecialSearch.php

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

DetailsEdit

  • $title will be the Title object of the page searched for if it doesn't exist. This hook only runs if the page being searched for doesn't exist.

See alsoEdit