< Manual:Hooks
SpecialSearchGoResult | |
---|---|
Available from version 1.27.0 Called before the 'go' feature of SpecialSearch redirects a user. May provide it's own url to redirect to. | |
Define function: | public static function onSpecialSearchGoResult( $term, Title $title, &$url ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"SpecialSearchGoResult": "MyExtensionHooks::onSpecialSearchGoResult"
}
}
|
Called from: | File(s): SpecialSearch.php |
Interface: | SpecialSearchGoResultHook.php |
For more information about attaching hooks, see Manual:Hooks
For examples of extensions using this hook, see Category:SpecialSearchGoResult extensions.
Description
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.
Details
$term - The string the user searched for
$title - The title the 'go' feature has decided to forward the user to
&$url - Initially null, hook subscribers can set this to specify the final url to redirect to
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.