Hooks can return three possible values:
- * true: the hook has operated successfully
+ * No return value (or null): the hook has operated successfully. Previously,
+ true was required. This is the default since MediaWiki 1.23.
* "some string": an error occurred; processing should stop and the error
should be shown to the user
* false: the hook has successfully done the work necessary and the calling
'APIEditBeforeSave': Before saving a page with api.php?action=edit, after
processing request parameters. Return false to let the request fail, returning
an error message or an <edit result="Failure"> tag if $resultArr was filled.
+Unlike for example 'EditFilterMergedContent' this also being run on undo.
$editPage: the EditPage object
$text: the new text of the article (has yet to be saved)
&$resultArr: data in this array will be added to the API result
$request: $wgRequest
$mediaWiki: The $mediawiki object
+'MediaWikiServices': Override services in the default MediaWikiServices instance.
+Extensions may use this to define, replace, or wrap existing services.
+However, the preferred way to define a new service is the $wgServiceWiringFiles array.
+$services: MediaWikiServices
+
'MessageCache::get': When fetching a message. Can be used to override the key
for customisations. Given and returned message key must be in special format:
1) first letter must be in lower case according to the content language.
$subPage: the subpage string or null if no subpage was specified
'SpecialPageBeforeExecute': Called before SpecialPage::execute.
+Return false to prevent execution.
$special: the SpecialPage object
$subPage: the subpage string or null if no subpage was specified
$t: title object searched for
&$params: an array of the default message name and page title (as parameter)
+'SpecialSearchGoResult': 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.
+$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
+
'SpecialSearchNogomatch': Called when user clicked the "Go" button but the
target doesn't exist.
&$title: title object generated from the text entered by the user