Manual:Hooks/SpecialSearchCreateLink

From MediaWiki.org
Jump to: navigation, search
SpecialSearchCreateLink
Available from version 1.18.0 (r97175)
Called when making the message to create a page or go to the existing page.

Define function:
public static function onSpecialSearchCreateLink( &$t, &$params ) { ... }

Attach hook:
$wgHooks['SpecialSearchCreateLink'][] = 'MyExtensionHooks::onSpecialSearchCreateLink';
Called from: SpecialSearch.php

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


[edit] Details

Called on Special:Search when making the message to create a page or go to the existing page.

  • $t is the Title object of the search term
  • $params is an array containing
    • the message name, by default one of 'searchmenu-exists', 'searchmenu-new', 'searchmenu-new-nocreate'
    • the search term as escaped parameter

Parameters for the message can be added by adding values to the $params array.

No message will be displayed if the message name is false or null.

[edit] See also

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox