$EditPage: the EditPage object
'AlternateUserMailer': Called before mail is sent so that mail could
-be logged (or something else) instead of using PEAR or SMTP
+be logged (or something else) instead of using PEAR or PHP's mail().
+Return false to skip the regular method of sending mail. Return a
+string to return a php-mail-error message containing the error.
+Returning true will continue with sending email in the regular way.
$headers: Associative array of headers for the email
$to: MailAddress object or array
$from: From address
$section: (No longer used)
$flags: Flags passed to Article::doEdit()
$revision: New Revision of the article
+$status: Status object about to be returned by doEdit()
$baseRevId: the rev ID (or false) this edit was based on
'ArticleUndelete': When one or more revisions of an article are restored
follwed an redirect
$article: target article (object)
+'ArticleViewCustom': allows to output the text of the article in a different format than wikitext
+$text: text of the page
+$title: title of the page
+$output: reference to $wgOut
+
'AuthPluginAutoCreate': Called when creating a local account for an user logged
in from an external authentication method
$user: User object created locally
$user: user
$result: result of checking autopromote condition
+'BacklinkCacheGetPrefix': allows to set prefix for a spefific link table
+$table: table name
+&$prefix: prefix
+
+'BacklinkCacheGetConditions': allows to set conditions for query when links to certain title
+are fetched
+$table: table name
+$title: title of the page to which backlinks are sought
+&$conds: query conditions
+
'BadImage': When checking against the bad image list
$name: Image name being checked
&$bad: Whether or not the image is "bad"
'BeforeParserFetchFileAndTitle': before an image is rendered by Parser
$parser: Parser object
$nt: the image title
-&$time: the image timestamp (use '0' to force a broken thumbnail)
-&$sha1: image base 36 sha1 (used to specify the file, $nt will be ignored if this is set)
+&$options: array of options to RepoGroup::findFile
&$descQuery: query string to add to thumbnail URL
+If 'broken' is a key in $options then the file will appear as a broken thumbnail.
+
'BeforeParserFetchTemplateAndtitle': before a template is fetched by Parser
$parser: Parser object
$title: title of the template
'ContribsPager::getQueryInfo': Before the contributions query is about to run
&$pager: Pager object for contributions
-&queryInfo: The query for the contribs Pager
+&$queryInfo: The query for the contribs Pager
'ContributionsLineEnding': Called before a contributions HTML line is finished
$page: SpecialPage object for contributions
'EditPage::showEditForm:initial': before showing the edit form
$editor: EditPage instance (object)
-$formCallback: Array for callback of modifying the edit form
Return false to halt editing; you'll need to handle error messages, etc.
yourself. Alternatively, modifying $error and returning true will cause the
$editToken: The user's edit token.
&$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage.
+'exemptFromAccountCreationThrottle': Exemption from the account creation throttle
+$ip: The ip address of the user
+
'ExtensionTypes': called when generating the extensions credits, use this to change the tables headers
&$extTypes: associative array of extensions types
&$cookies: array of cookies name, add a value to it if you want to add a cookie
that have to vary cache options
+'GetCanonicalURL': modify fully-qualified URLs used for IRC and e-mail notifications
+$title: Title object of page
+$url: string value as output (out parameter, can modify)
+$query: query options passed to Title::getCanonicalURL()
+$variant: variant passed to Title::getCanonicalURL()
+
'GetDefaultSortkey': Override the default sortkey for a page.
$title: Title object that we need to get a sortkey for
&$sortkey: Sortkey to use.
$title: Title object of page
$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getFullURL()
+$variant: variant passed to Title::getFullURL()
'GetInternalURL': modify fully-qualified URLs used for squid cache purging
$title: Title object of page
$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getInternalURL()
+$variant: variant passed to Title::getFullURL()
'GetIP': modify the ip of the current user (called only once)
&$ip: string holding the ip as determined so far
indexed by page_id.
&$colours: (output) array of CSS classes, indexed by prefixed DB keys
-'GetLocalURL': modify local URLs as output into page links
+'GetLocalURL': modify local URLs as output into page links. Note that if you
+ are working with internal urls (non-interwiki) then it may be preferable
+ to work with the GetLocalURL::Internal or GetLocalURL::Article hooks as
+ GetLocalURL can be buggy for internal urls on render if you do not
+ re-implement the horrible hack that Title::getLocalURL uses
+ in your own extension.
$title: Title object of page
-$url: string value as output (out parameter, can modify)
+&$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getLocalURL()
+$variant: variant passed to Title::getLocalURL()
+
+'GetLocalURL::Internal': modify local URLs to internal pages.
+$title: Title object of page
+&$url: string value as output (out parameter, can modify)
+$query: query options passed to Title::getLocalURL()
+$variant: variant passed to Title::getLocalURL()
+
+'GetLocalURL::Article': modify local URLs specifically pointing to article paths
+ without any fancy queries or variants.
+$title: Title object of page
+&$url: string value as output (out parameter, can modify)
'GetMetadataVersion': modify the image metadata version currently in use. This is
used when requesting image metadata from a ForiegnApiRepo. Media handlers
'InvalidateEmailComplete': Called after a user's email has been invalidated successfully
$user: user (object) whose email is being invalidated
+'IRCLineURL': When constructing the URL to use in an IRC notification.
+Callee may modify $url and $query, URL will be constructed as $url . $query
+&$url: URL to index.php
+&$query: Query string
+
'IsFileCacheable': Override the result of Article::isFileCacheable() (if true)
$article: article (object) being checked
&$result: Set this and return false to override the internal checks
$user: User the password is being validated for
+'LanguageGetNamespaces': Provide custom ordering for namespaces or
+remove namespaces. Do not use this hook to add namespaces. Use
+CanonicalNamespaces for that.
+&$namespaces: Array of namespaces indexed by their numbers
+
'LanguageGetMagic': DEPRECATED, use $magicWords in a file listed in
$wgExtensionMessagesFiles instead.
Use this to define synonyms of magic words depending of the language
$code: language code
&$alldata: The localisation data from core and extensions
+'LogEventsListShowLogExtract': called before the string is added to OutputPage. Returning false will prevent the string from being added to the OutputPage
+&$s: html string to show for the log extract
+$types: String or Array (''isn't documented on showLogExtract() yet, not sure what it is'')
+$page: String The page title to show log entries for
+$user: String The user who made the log entries
+$param: Associative Array with the following additional options:
+ - lim Integer Limit of items to show, default is 50
+ - conds Array Extra conditions for the query (e.g. "log_action != 'revision'")
+ - showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty if set to true (default), "No matching items in log" is displayed if loglist is empty
+ - msgKey Array If you want a nice box with a message, set this to the key of the message. First element is the message key, additional optional elements are parameters for the key that are processed with wgMsgExt and option 'parse'
+ - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset
+ - wrap String Wrap the message in html (usually something like "<div ...>$1</div>").
+ - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
+
'LoginAuthenticateAudit': a login attempt for a valid user account either
succeeded or failed. No return data is accepted; this hook is for auditing only.
$user: the User object being authenticated against
through ResourceLoaderGetConfigVars instead.
&$vars: variable (or multiple variables) to be added into the output
of Skin::makeVariablesScript
+&$out: The OutputPage which called the hook,
+ can be used to get the real title
'MarkPatrolled': before an edit is marked patrolled
$rcid: ID of the revision to be marked patrolled
$links: array, intended to hold the result. Must be an associative array with
category types as keys and arrays of HTML links as values.
+'PageContentLanguage': allows changing the language in which the content of
+a page is written. Defaults to the wiki content language ($wgContLang).
+$title: Title object
+&$pageLang: the page content language (either an object or a language code)
+$wgLang: the user language
+
'PageHistoryBeforeList': When a history page list is about to be constructed.
$article: the article that the history is loading for
can begin in one section and end in another. Make sure your code can handle
that case gracefully. See the EditSectionClearerLink extension for an
example.
-$this: the calling Parser instance
+$parser: the calling Parser instance
$section: the section number, zero-based, but section 0 is usually empty
&$sectionContent: ref to the content of the section. modify this.
$showEditLinks: boolean describing whether this section has an edit link
&$query_options: array of options for the database request
&$select: Array of columns to select
+'SpecialSearchCreateLink': called when making the message to create a page or
+go to the existing page
+$t: title object searched for
+&$params: an array of the default message name and page title (as parameter)
+
'SpecialSearchGo': called when user clicked the "Go"
&$title: title object generated from the text entered by the user
&$term: the search term entered by the user
target doesn't exist
&$title: title object generated from the text entered by the user
+'SpecialSearchPowerBox': the equivalent of SpecialSearchProfileForm for
+the advanced form, a.k.a. power search box
+&$showSections: an array to add values with more options to
+$term: the search term (not a title object)
+$opts: an array of hidden options (containing 'redirs' and 'profile')
+
'SpecialSearchProfiles': allows modification of search profiles
&$profiles: profiles, which can be modified.
&$join_conds: join conditions for the tables
&$fields: array of query fields
+'TestCanonicalRedirect': called when about to force a redirect to a canonical URL for a title when we have no other parameters on the URL. Gives a chance for extensions that alter page view behavior radically to abort that redirect or handle it manually.
+$request: WebRequest
+$title: Title of the currently found title obj
+$output: OutputPage object
+
'TitleArrayFromResult': called when creating an TitleArray object from a
database result
&$titleArray: set this to an object to override the default object returned
$title: The title in question.
&$types: The types of protection available.
+'TitleIsCssOrJsPage': Called when determining if a page is a CSS or JS page
+$title: Title object that is being checked
+$result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page. Hooks may change this value to override the return value of Title::isCssOrJsPage()
+
+'TitleIsMovable': Called when determining if it is possible to move a page.
+Note that this hook is not called for interwiki pages or pages in immovable namespaces: for these, isMovable() always returns false.
+$title: Title object that is being checked
+$result: Boolean; whether MediaWiki currently thinks this page is movable. Hooks may change this value to override the return value of Title::isMovable()
+
+'TitleIsWikitextPage': Called when determining if a page is a wikitext or should
+be handled by seperate handler (via ArticleViewCustom)
+$title: Title object that is being checked
+$result: Boolean; whether MediaWiki currently thinks this is a wikitext page. Hooks may change this value to override the return value of Title::isWikitextPage()
+
'TitleMoveComplete': after moving an article (title)
$old: old title
$nt: new title
'UserGetAllRights': after calculating a list of all available rights
&$rights: Array of rights, which may be added to.
+'UserGetDefaultOptions': after fetching the core default, this hook is ran
+right before returning the options to the caller.
+&$defaultOptions: Array of preference keys and their default values.
+
'UserGetEmail': called when getting an user email address
$user: User object
&$email: email, change this to override local email
$redirect: whether the page is a redirect
$skin: Skin object
+'WebRequestGetPathInfoRequestURI': while extracting path info from REQUEST_URI.
+ Allows an extension to extend the extraction of titles from paths.
+ Implementing hooks should follow the pattern used in core:
+ * Use the `$matches = WebRequest::extractTitle` pattern
+ * Ensure that you test `if ( !$matches ) {` before you try extracting a title
+ from the path so that you don't override an already found match.
+$path: The request path to extract a title from.
+&$matches: The array to apply matches to.
+
'WikiExporter::dumpStableQuery': Get the SELECT query for "stable" revisions
dumps
One, and only one hook should set this, and return false.