Extension hook registry

From MediaWiki.org

Jump to: navigation, search
This page is for registering hooks created by your extension. If you would like to document hooks used by your extension, please use the hook1, hook2, etc parameters on the Extension template embedded in your extension article.

The Hooks mechanism in MediaWiki is a powerful tool for extension authors to modify the behavior of MediaWiki while minimizing, if not eliminating, the need to hack the codebase. A logical extension of this idea is to place hooks in extensions themselves, in order to allow other developers to extend the extensions. This page provides a listing and documentation for hooks provided by extension authors. To document your hook:

  1. create a page named after the hook under your extension, e.g. Extension:MyExtension/MyHook. Note: this naming convention allows defaults and category links in Template:Extension and Template:SeeCustomHook to work properly
  2. place the Template:Extension in your page and fill in the parameter values
  3. add a row for your hook in the table below

[edit] Extension hooks by parent extension

Parent extension Version Hook Description
Backup Backup Hook event called when a page change is effected
CategoryHook 0.2 CategoryHook Adds a hook allowing articles to be added to additional categories based on wikitext content.
CentralAuth 1.13 CentralAuthWikiList Get the list of wikis in which CentralAuth is active
ContactPage ContactForm Can be used to manipulate most of the values related to the contact message: the sender, the receiver, the subject and the actual contact message text.
ContactPage ContactFromComplete Takes the same parameters as ContactForm hook does.
DatabaseFetchObject 0.1 DatabaseFetchObject Hook for checking permissions in any context where database page contents are retrieved.
ImagePageEx ImagePageEx Hooks for trapping delete related changes in NS_IMAGE
LDAP Authentication 1.1c+ SetUsernameAttributeFromLDAP Allows hook function to set the LDAP username from various attributes returned by a query.
PagesOnDemand 0.1 PagesOnDemand Hook for modules that create new pages from templates when links to nonexistent pages are followed
Renameuser 1.11 RenameUserAbort Allow other extensions to abort a user rename
Renameuser 1.11 RenameUserComplete After a successful user rename
Renameuser 1.13 RenameUserPreRename Before renaming a user
Renameuser r55189 RenameUserSQL In the constructor of RenameuserSQL class, allows adding tables to the array of tables that Renameuser should update on rename
Renameuser 1.13 RenameUserWarning Get warnings when renaming a user
Shibboleth Authentication ShibUpdateUser Hook event called before user information gets updated on login (for setting the name/mail from Shibboleth)


Extensions: CategoryAllRequestsTag extensionsExtension MatrixExtensions FAQExtension hook registry — {{Extension}}