Manual:Hooks/SpecialSearchPowerBox

From mediawiki.org
SpecialSearchPowerBox
Available from version 1.18.0 (r97175, codereview)
The equivalent of SpecialSearchProfileForm for the advanced form, a.k.a. power search box
Define function:
public static function onSpecialSearchPowerBox( &$showSections, $term, $opts ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"SpecialSearchPowerBox": "MediaWiki\\Extension\\MyExtension\\Hooks::onSpecialSearchPowerBox"
	}
}
Called from: File(s): specials/SpecialSearch.php
Interface: SpecialSearchPowerBoxHook.php

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


Details[edit]

The equivalent of SpecialSearchProfileForm for the advanced form, a.k.a. power search box.

  • The first parameter, $showSections, is an array of the following keys containing input forms:
    • 'namespaceTables'
    • 'redirects' (if supported by the search engine)
  • $term is the search term
  • $opts is an array of hidden options with keys 'redirs' and 'profile', of which only 'profile' is added as hidden input. Starting from MediaWiki 1.32, $opts passed by reference. This mean allowing extensions to modify or even unset it.

See also[edit]