From MediaWiki.org
Jump to navigation Jump to search

Other languages:
English • ‎dansk • ‎polski • ‎العربية • ‎中文 • ‎日本語
Template documentation

Copy and paste template[edit]

Available from version ???

Define function:
public static function onMyHook( $x, $y ) { ... }
Attach hook:
$wgHooks['MyHook'][] = 'MyExtensionHooks::onMyHook';
Called from:File(s):

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

|name = MyHook
|version =
|gerrit =
|removed =
|summary =
|args = $x, $y
|source =
|sourcefunction =
|sourceclass =
|newvarname =
|newvarlink =

Usage notes[edit]

The name of the hook. This is usually the same name as the sub-page.
The version of MediaWiki this hook was first introduced in.
SVN revision in which this hook was first introduced. If this parameter is given, it'll link to the appropriate CodeReview page (e.g. Special:Code/MediaWiki/1).
Gerrit change number in which this hook was first introduced. If this parameter is given, it'll link to the appropriate Gerrit changeset page (e.g. Gerrit change 1)
If the hook has been removed, the version of MediaWiki that it was removed in.
If the hook has been deprecated (but not removed), the version of MediaWiki that it was deprecated in.
A short description of the hook's purpose.
More detailed descriptions are desirable, and should be added to the main page content.
If you update the short description, please also update the two tables on Manual:Hooks .
The arguments, as used at the top of the function.
Location (file name) which calls this hook in the code. Further locations can be added via source2...source10.
Name of the function which calls this hook. Another can be added via sourcefunction.
Name of the class which calls this hook.
Set to nocats if hook documentation should not appear in standard MediaWiki Categories.
By default, using this template places the documentation page into categories:
  • MediaWiki hooks
  • Hooks added in MediaWiki...
There are times when it is undesirable to automatically categorize the hook documentation. Examples would include when documenting a hook in an extension, or when documenting the template itself.