MediaWiki REL1_39
MediaWiki\Hook\SpecialSearchGoResultHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inheritance diagram for MediaWiki\Hook\SpecialSearchGoResultHook:

Public Member Functions

 onSpecialSearchGoResult ( $term, $title, &$url)
 Use this hook to alter the behaviour of the 'go' feature when searching.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "SpecialSearchGoResult" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 14 of file SpecialSearchGoResultHook.php.

Member Function Documentation

◆ onSpecialSearchGoResult()

MediaWiki\Hook\SpecialSearchGoResultHook::onSpecialSearchGoResult ( $term,
$title,
& $url )

Use this hook to alter the behaviour of the 'go' feature when searching.

If a hook returns false the 'go' feature will be canceled and a normal search will be performed. Returning true without setting $url does a standard redirect to $title. Setting $url redirects to the specified URL.

Since
1.35
Parameters
string$termThe string the user searched for
Title$titleThe title the 'go' feature has decided to forward the user to
string | null&$urlInitially null, hook subscribers can set this to specify the final url to redirect to
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: