page is saved. A wiki page is deleted. Often there are two events
associated with a single action: one before the code is run to make the
event happen, and one after. Each event has a name, preferably in
- CamelCase. For example, 'UserLogin', 'ArticleSave', 'ArticleSaveComplete',
- 'ArticleDelete'.
+ CamelCase. For example, 'UserLogin', 'PageContentSave',
+ 'PageContentSaveComplete', 'ArticleDelete'.
hook
A clump of code and data that should be run when an event happens. This can
The extra data is useful if we want to use the same function or object for
different purposes. For example:
- $wgHooks['ArticleSaveComplete'][] = array( 'ircNotify', 'TimStarling' );
- $wgHooks['ArticleSaveComplete'][] = array( 'ircNotify', 'brion' );
+ $wgHooks['PageContentSaveComplete'][] = array( 'ircNotify', 'TimStarling' );
+ $wgHooks['PageContentSaveComplete'][] = array( 'ircNotify', 'brion' );
This code would result in ircNotify being run twice when an article is saved:
once for 'TimStarling', and once for 'brion'.
'AbortAutoblock': Return false to cancel an autoblock.
$autoblockip: The IP going to be autoblocked.
-$block: The block from which the autoblock is coming.
+&$block: The block from which the autoblock is coming.
'AbortChangePassword': Return false to cancel password change.
$user: the User object to which the password change is occuring
$parser: Parser object that called the hook
$ig: Gallery, an object of one of the gallery classes (inheriting from
ImageGalleryBase)
-$html: HTML generated by the gallery
+&$html: HTML generated by the gallery
'AlternateEdit': Before checking if a user can edit a page and before showing
the edit form ( EditPage::edit() ). This is triggered on &action=edit.
token is requested for and $title is the associated Title object. In the hook,
just add your callback to the $tokenFunctions array and return true (returning
false makes no sense).
-$tokenFunctions: array(action => callback)
+&$tokenFunctions: array(action => callback)
'APIQueryRecentChangesTokens': DEPRECATED! Use ApiQueryTokensRegisterTypes
instead.
associated Title object and $rc the associated RecentChange object. In the
hook, just add your callback to the $tokenFunctions array and return true
(returning false makes no sense).
-$tokenFunctions: array(action => callback)
+&$tokenFunctions: array(action => callback)
'APIQueryRevisionsTokens': DEPRECATED! Use ApiQueryTokensRegisterTypes instead.
Use this hook to add custom tokens to prop=revisions. Every token has an
associated Title object and $rev the associated Revision object. In the hook,
just add your callback to the $tokenFunctions array and return true (returning
false makes no sense).
-$tokenFunctions: array(action => callback)
+&$tokenFunctions: array(action => callback)
'APIQuerySiteInfoGeneralInfo': Use this hook to add extra information to the
sites general information.
function is func($user) where $user is the User object. In the hook, just add
your callback to the $tokenFunctions array and return true (returning false
makes no sense).
-$tokenFunctions: array(action => callback)
+&$tokenFunctions: array(action => callback)
'ApiRsdServiceApis': Add or remove APIs from the RSD services list. Each service
should have its own entry in the $apis array and have a unique name, passed as
'ArticleAfterFetchContent': DEPRECATED! Use ArticleAfterFetchContentObject
instead.
After fetching content of an article from the database.
-$article: the article (object) being loaded from the database
+&$article: the article (object) being loaded from the database
&$content: the content (string) of the article
'ArticleAfterFetchContentObject': After fetching content of an article from the
database.
-$article: the article (object) being loaded from the database
+&$article: the article (object) being loaded from the database
&$content: the content of the article, as a Content object
'ArticleConfirmDelete': Before writing the confirmation form for article
$output: reference to $wgOut
'ArticleDelete': Before an article is deleted.
-$wikiPage: the WikiPage (object) being deleted
-$user: the user (object) deleting the article
-$reason: the reason (string) the article is being deleted
-$error: if the deletion was prohibited, the (raw HTML) error message to display
+&$wikiPage: the WikiPage (object) being deleted
+&$user: the user (object) deleting the article
+&$reason: the reason (string) the article is being deleted
+&$error: if the deletion was prohibited, the (raw HTML) error message to display
(added in 1.13)
-$status: Status object, modify this to throw an error. Overridden by $error
+&$status: Status object, modify this to throw an error. Overridden by $error
(added in 1.20)
$suppress: Whether this is a suppression deletion or not (added in 1.27)
$outputPage: OutputPage that can be used to append the output.
'ArticleDeleteComplete': After an article is deleted.
-$wikiPage: the WikiPage that was deleted
-$user: the user that deleted the article
+&$wikiPage: the WikiPage that was deleted
+&$user: the user that deleted the article
$reason: the reason the article was deleted
$id: id of the article that was deleted
$content: the Content of the deleted page
'ArticleEditUpdates': When edit updates (mainly link tracking) are made when an
article has been changed.
-$wikiPage: the WikiPage (object)
-$editInfo: data holder that includes the parser output ($editInfo->output) for
+&$wikiPage: the WikiPage (object)
+&$editInfo: data holder that includes the parser output ($editInfo->output) for
that page after the change
$changed: bool for if the page was changed
'ArticleEditUpdatesDeleteFromRecentchanges': Before deleting old entries from
recentchanges table, return false to not delete old entries.
-$wikiPage: WikiPage (object) being modified
+&$wikiPage: WikiPage (object) being modified
'ArticleFromTitle': when creating an article object from a title object using
Wiki::articleFromTitle().
-$title: Title (object) used to create the article object
-$article: Article (object) that will be returned
+&$title: Title (object) used to create the article object
+&$article: Article (object) that will be returned
$context: IContextSource (object)
'ArticleInsertComplete': DEPRECATED! Use PageContentInsertComplete.
$destTitle: destination title (object)
'ArticlePageDataAfter': After loading data of an article from the database.
-$wikiPage: WikiPage (object) whose data were loaded
-$row: row (object) returned from the database server
+&$wikiPage: WikiPage (object) whose data were loaded
+&$row: row (object) returned from the database server
'ArticlePageDataBefore': Before loading data of an article from the database.
-$wikiPage: WikiPage (object) that data will be loaded
-$fields: fields (array) to load from the database
+&$wikiPage: WikiPage (object) that data will be loaded
+&$fields: fields (array) to load from the database
'ArticlePrepareTextForEdit': Called when preparing text to be saved.
$wikiPage: the WikiPage being saved
$popts: parser options to be used for pre-save transformation
'ArticleProtect': Before an article is protected.
-$wikiPage: the WikiPage being protected
-$user: the user doing the protection
+&$wikiPage: the WikiPage being protected
+&$user: the user doing the protection
$protect: Set of restriction keys
$reason: Reason for protect
'ArticleProtectComplete': After an article is protected.
-$wikiPage: the WikiPage that was protected
-$user: the user who did the protection
+&$wikiPage: the WikiPage that was protected
+&$user: the user who did the protection
$protect: Set of restriction keys
$reason: Reason for protect
'ArticlePurge': Before executing "&action=purge".
-$wikiPage: WikiPage (object) to purge
+&$wikiPage: WikiPage (object) to purge
'ArticleRevisionUndeleted': After an article revision is restored.
-$title: the article title
+&$title: the article title
$revision: the revision
$oldPageID: the page ID of the revision when archived (may be null)
$baseRevId: the rev ID (or false) this edit was based on
'ArticleUndelete': When one or more revisions of an article are restored.
-$title: Title corresponding to the article restored
+&$title: Title corresponding to the article restored
$create: Whether or not the restoration caused the page to be created (i.e. it
didn't exist before).
$comment: The comment associated with the undeletion.
'ArticleUpdateBeforeRedirect': After a page is updated (usually on save), before
the user is redirected back to the page.
-&$article: the article
+$article: the article
&$sectionanchor: The section anchor link (e.g. "#overview" )
&$extraq: Extra query parameters which can be added via hooked functions
'ArticleViewRedirect': Before setting "Redirected from ..." subtitle when a
redirect was followed.
-$article: target article (object)
+&$article: target article (object)
'AuthPluginAutoCreate': Called when creating a local account for an user logged
in from an external authentication method.
$type: condition type
$args: arguments
$user: user
-$result: result of checking autopromote condition
+&$result: result of checking autopromote condition
'BacklinkCacheGetConditions': Allows to set conditions for query when links to
certain title are fetched.
'BeforeInitialize': Before anything is initialized in
MediaWiki::performRequest().
&$title: Title being used for request
-$unused: null
+&$unused: null
&$output: OutputPage object
&$user: User
$request: WebRequest object
&$mto: null, set to a MediaTransformOutput
'BlockIp': Before an IP address or user is blocked.
-$block: the Block object about to be saved
-$user: the user _doing_ the block (not the one being blocked)
+&$block: the Block object about to be saved
+&$user: the user _doing_ the block (not the one being blocked)
&$reason: if the hook is aborted, the error message to be returned in an array
'BlockIpComplete': After an IP address or user is blocked.
$wikiPage: WikiPage that was removed
'CategoryPageView': Before viewing a categorypage in CategoryPage::view.
-$catpage: CategoryPage instance
+&$catpage: CategoryPage instance
'CategoryViewer::doCategoryQuery': After querying for pages to be displayed
in a Category page. Gives extensions the opportunity to batch load any
$user: User performing the edit
'DatabaseOraclePostInit': Called after initialising an Oracle database
-&$db: the DatabaseOracle object
+$db: the DatabaseOracle object
'DeletedContribsPager::reallyDoQuery': Called before really executing the query
for Special:DeletedContributions
'DisplayOldSubtitle': before creating subtitle when browsing old versions of
an article
-$article: article (object) being viewed
-$oldid: oldid (int) being viewed
+&$article: article (object) being viewed
+&$oldid: oldid (int) being viewed
'DoEditSectionLink': DEPRECATED! Use SkinEditSectionLinks instead.
Override the HTML generated for section edit links
'EditPage::showEditForm:fields': allows injection of form field into edit form
Return value is ignored (should always return true)
-$editor: the EditPage instance for reference
-$out: an OutputPage instance to write to
+&$editor: the EditPage instance for reference
+&$out: an OutputPage instance to write to
'EditPage::showEditForm:initial': before showing 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
contents of $error to be echoed at the top of the edit form as wikitext.
Return true without altering $error to allow the edit to proceed.
-$editor: EditPage instance (object)
-$out: an OutputPage instance to write to
+&$editor: EditPage instance (object)
+&$out: an OutputPage instance to write to
'EditPage::showReadOnlyForm:initial': similar to EditPage::showEditForm:initial
but for the read-only 'view source' variant of the edit form.
'EmailConfirmed': When checking that the user's email address is "confirmed".
This runs before the other checks, such as anonymity and the real check; return
true to allow those checks to occur, and false if checking is done.
-$user: User being checked
-$confirmed: Whether or not the email address is confirmed
+&$user: User being checked
+&$confirmed: Whether or not the email address is confirmed
'EmailUser': Before sending email from one user to another.
-$to: MailAddress object of receiving user
-$from: MailAddress object of sending user
-$subject: subject of the mail
-$text: text of the mail
+&$to: MailAddress object of receiving user
+&$from: MailAddress object of sending user
+&$subject: subject of the mail
+&$text: text of the mail
&$error: Out-param for an error
'EmailUserCC': Before sending the copy of the email to the author.
-$to: MailAddress object of receiving user
-$from: MailAddress object of sending user
-$subject: subject of the mail
-$text: text of the mail
+&$to: MailAddress object of receiving user
+&$from: MailAddress object of sending user
+&$subject: subject of the mail
+&$text: text of the mail
'EmailUserComplete': After sending email from one user to another.
$to: MailAddress object of receiving user
$text: text of the mail
'EmailUserForm': After building the email user form object.
-$form: HTMLForm object
+&$form: HTMLForm object
'EmailUserPermissionsErrors': to retrieve permissions errors for emailing a
user.
return false override the list derivative used)
'FileDeleteComplete': When a file is deleted.
-$file: reference to the deleted file
-$oldimage: in case of the deletion of an old image, the name of the old file
-$article: in case all revisions of the file are deleted a reference to the
+&$file: reference to the deleted file
+&$oldimage: in case of the deletion of an old image, the name of the old file
+&$article: in case all revisions of the file are deleted a reference to the
WikiFilePage associated with the file.
-$user: user who performed the deletion
-$reason: reason
+&$user: user who performed the deletion
+&$reason: reason
'FileTransformed': When a file is transformed and moved into storage.
$file: reference to the File object
'GetAutoPromoteGroups': When determining which autopromote groups a user is
entitled to be in.
-&$user: user to promote.
+$user: user to promote.
&$promote: groups that will be added.
'GetBlockedStatus': after loading blocking status of an user from the database
-$user: user (object) being checked
+&$user: user (object) being checked
'GetCacheVaryCookies': Get cookies that should vary cache options.
$out: OutputPage object
'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)
+&$title: Title object of page
+&$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getCanonicalURL()
'GetDefaultSortkey': Override the default sortkey for a page.
&$maxCacheTime: how long the results can be cached
'GetFullURL': Modify fully-qualified URLs used in redirects/export/offsite data.
-$title: Title object of page
-$url: string value as output (out parameter, can modify)
+&$title: Title object of page
+&$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getFullURL()
'GetHumanTimestamp': Pre-emptively override the human-readable timestamp
$lang: Language that will be used to render the timestamp
'GetInternalURL': Modify fully-qualified URLs used for squid cache purging.
-$title: Title object of page
-$url: string value as output (out parameter, can modify)
+&$title: Title object of page
+&$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getInternalURL()
'GetIP': modify the ip of the current user (called only once).
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
+&$title: Title object of page
&$url: string value as output (out parameter, can modify)
$query: query options 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
+&$title: Title object of page
&$url: string value as output (out parameter, can modify)
'GetLocalURL::Internal': Modify local URLs to internal pages.
-$title: Title object of page
+&$title: Title object of page
&$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getLocalURL()
'getUserPermissionsErrors': Add a permissions error when permissions errors are
checked for. Use instead of userCan for most cases. Return false if the user
can't do it, and populate $result with the reason in the form of
-array( messagename, param1, param2, ... ). For consistency, error messages
+array( messagename, param1, param2, ... ) or a MessageSpecifier instance (you
+might want to use ApiMessage to provide machine-readable details for the API).
+For consistency, error messages
should be plain text with no special coloring, bolding, etc. to show that
they're errors; presenting them properly to the user as errors is done by the
caller.
-$title: Title object being checked against
-$user: Current user object
+&$title: Title object being checked against
+&$user: Current user object
$action: Action being checked
-$result: User permissions error to add. If none, return true.
+&$result: User permissions error to add. If none, return true.
'getUserPermissionsErrorsExpensive': Equal to getUserPermissionsErrors, but is
called only if expensive checks are enabled. Add a permissions error when
permissions errors are checked for. Return false if the user can't do it, and
populate $result with the reason in the form of array( messagename, param1,
-param2, ... ). For consistency, error messages should be plain text with no
+param2, ... ) or a MessageSpecifier instance (you might want to use ApiMessage
+to provide machine-readable details for the API). For consistency, error
+messages should be plain text with no
special coloring, bolding, etc. to show that they're errors; presenting them
properly to the user as errors is done by the caller.
-$title: Title object being checked against
-$user: Current user object
+&$title: Title object being checked against
+&$user: Current user object
$action: Action being checked
-$result: User permissions error to add. If none, return true.
+&$result: User permissions error to add. If none, return true.
'GitViewers': Called when generating the list of git viewers for
Special:Version, use this to change the list.
'ImageOpenShowImageInlineBefore': Call potential extension just before showing
the image on an image page.
-$imagePage: ImagePage object ($this)
-$output: $wgOut
+&$imagePage: ImagePage object ($this)
+&$output: $wgOut
'ImagePageAfterImageLinks': Called after the image links section on an image
page is built.
'ImportHandlePageXMLTag': When parsing a XML tag in a page.
Return false to stop further processing of the tag
$reader: XMLReader object
-$pageInfo: Array of information
+&$pageInfo: Array of information
'ImportHandleRevisionXMLTag': When parsing a XML tag in a page revision.
Return false to stop further processing of the tag
&$pageInfo: Array of information
'InitializeArticleMaybeRedirect': MediaWiki check to see if title is a redirect.
-$title: Title object for the current page
-$request: WebRequest
-$ignoreRedirect: boolean to skip redirect check
-$target: Title/string of redirect target
-$article: Article object
+&$title: Title object for the current page
+&$request: WebRequest
+&$ignoreRedirect: boolean to skip redirect check
+&$target: Title/string of redirect target
+&$article: Article object
'InternalParseBeforeLinks': during Parser's internalParse method before links
but after nowiki/noinclude/includeonly/onlyinclude and other processings.
$rc: RecentChange object that triggered url generation
'IsFileCacheable': Override the result of Article::isFileCacheable() (if true)
-$article: article (object) being checked
+&$article: article (object) being checked
'IsTrustedProxy': Override the result of wfIsTrustedProxy()
-$ip: IP being check
-$result: Change this value to override the result of wfIsTrustedProxy()
+&$ip: IP being check
+&$result: Change this value to override the result of wfIsTrustedProxy()
'IsUploadAllowedFromUrl': Override the result of UploadFromUrl::isAllowedUrl()
$url: URL used to upload from
'LanguageGetMagic': DEPRECATED! Use $magicWords in a file listed in
$wgExtensionMessagesFiles instead.
Use this to define synonyms of magic words depending of the language
-$magicExtensions: associative array of magic words synonyms
+&$magicExtensions: associative array of magic words synonyms
$lang: language code (string)
'LanguageGetNamespaces': Provide custom ordering for namespaces or
'LanguageGetSpecialPageAliases': DEPRECATED! Use $specialPageAliases in a file
listed in $wgExtensionMessagesFiles instead.
Use to define aliases of special pages names depending of the language
-$specialPageAliases: associative array of magic words synonyms
+&$specialPageAliases: associative array of magic words synonyms
$lang: language code (string)
'LanguageGetTranslatedLanguageNames': Provide translated language names.
&$tags: The list of tags.
'LoadExtensionSchemaUpdates': Called during database installation and updates.
-&$updater: A DatabaseUpdater subclass
+$updater: A DatabaseUpdater subclass
'LocalFile::getHistory': Called before file history query performed.
-$file: the File object
-$tables: tables
-$fields: select fields
-$conds: conditions
-$opts: query options
-$join_conds: JOIN conditions
+&$file: the File object
+&$tables: tables
+&$fields: select fields
+&$conds: conditions
+&$opts: query options
+&$join_conds: JOIN conditions
'LocalFilePurgeThumbnails': Called before thumbnails for a local file a purged.
$file: the File object
&$joinConds: join conditions for the query
'MagicWordwgVariableIDs': When defining new magic words IDs.
-$variableIDs: array of strings
+&$variableIDs: array of strings
'MaintenanceRefreshLinksInit': before executing the refreshLinks.php maintenance
script.
'MarkPatrolled': Before an edit is marked patrolled.
$rcid: ID of the revision to be marked patrolled
-$user: the user (object) marking the revision as patrolled
+&$user: the user (object) marking the revision as patrolled
$wcOnlySysopsCanPatrol: config setting indicating whether the user needs to be a
sysop in order to mark an edit patrolled.
-$auto true if the edit is being marked as patrolled automatically
+$auto: true if the edit is being marked as patrolled automatically
'MarkPatrolledComplete': After an edit is marked patrolled.
$rcid: ID of the revision marked as patrolled
-$user: user (object) who marked the edit patrolled
+&$user: user (object) who marked the edit patrolled
$wcOnlySysopsCanPatrol: config setting indicating whether the user must be a
sysop to patrol the edit.
-$auto true if the edit is being marked as patrolled automatically
+$auto: true if the edit is being marked as patrolled automatically
'MediaWikiPerformAction': Override MediaWiki::performAction(). Use this to do
something completely different, after the basic globals have been set up, but
'MessagesPreLoad': When loading a message from the database.
$title: title of the message (string)
-$message: value (string), change it to the message you want to define
+&$message: value (string), change it to the message you want to define
'MimeMagicGuessFromContent': Allows MW extensions guess the MIME by content.
$mimeMagic: Instance of MimeMagic.
'NamespaceIsMovable': Called when determining if it is possible to pages in a
namespace.
$index: Integer; the index of the namespace being checked.
-$result: Boolean; whether MediaWiki currently thinks that pages in this
+&$result: Boolean; whether MediaWiki currently thinks that pages in this
namespace are movable. Hooks may change this value to override the return
value of MWNamespace::isMovable().
return false to omit the line from RecentChanges and Watchlist special pages.
&$changeslist: The OldChangesList instance.
&$s: HTML of the form "<li>...</li>" containing one RC entry.
-&$rc: The RecentChange object.
+$rc: The RecentChange object.
&$classes: array of css classes for the <li> element
'OpenSearchUrls': Called when constructing the OpenSearch description XML. Hooks
'OtherBlockLogLink': Get links to the block log from extensions which blocks
users and/or IP addresses too.
-$otherBlockLink: An array with links to other block logs
+&$otherBlockLink: An array with links to other block logs
$ip: The requested IP address or username
'OutputPageBeforeHTML': A page has been processed by the parser and the
resulting HTML is about to be displayed.
-$parserOutput: the parserOutput (object) that corresponds to the page
-$text: the text that will be displayed, in HTML (string)
+&$parserOutput: the parserOutput (object) that corresponds to the page
+&$text: the text that will be displayed, in HTML (string)
'OutputPageBodyAttributes': Called when OutputPage::headElement is creating the
body tag to allow for extensions to add attributes to the body of the page they
'OutputPageMakeCategoryLinks': Links are about to be generated for the page's
categories. Implementations should return false if they generate the category
links, so the default link generation is skipped.
-$out: OutputPage instance (object)
+&$out: OutputPage instance (object)
$categories: associative array, keys are category names, values are category
types ("normal" or "hidden")
-$links: array, intended to hold the result. Must be an associative array with
+&$links: array, intended to hold the result. Must be an associative array with
category types as keys and arrays of HTML links as values.
'OutputPageParserOutput': after adding a parserOutput to $wgOut
-$out: OutputPage instance (object)
+&$out: OutputPage instance (object)
$parserOutput: parserOutput instance being added in $out
'PageContentInsertComplete': After a new article is created.
$baseRevId: the rev ID (or false) this edit was based on
'PageHistoryBeforeList': When a history page list is about to be constructed.
-$article: the article that the history is loading for
+&$article: the article that the history is loading for
$context: RequestContext object
'PageHistoryLineEnding': Right before the end <li> is added to a history line.
'PageHistoryPager::getQueryInfo': when a history pager query parameter set is
constructed.
-$pager: the pager
-$queryInfo: the query parameters
+&$pager: the pager
+&$queryInfo: the query parameters
'PageRenderingHash': Alter the parser cache option hash key. A parser extension
which depends on user options should install this hook and append its values to
'ParserAfterParse': Called from Parser::parse() just after the call to
Parser::internalParse() returns.
-$parser: parser object
-$text: text being parsed
-$stripState: stripState used (object)
+&$parser: parser object
+&$text: text being parsed
+&$stripState: stripState used (object)
'ParserAfterStrip': Called at end of parsing time.
TODO: No more strip, deprecated ?
-$parser: parser object
-$text: text being parsed
-$stripState: stripState used (object)
+&$parser: parser object
+&$text: text being parsed
+&$stripState: stripState used (object)
'ParserAfterTidy': Called after Parser::tidy() in Parser::parse()
-$parser: Parser object being used
-$text: text that will be returned
+&$parser: Parser object being used
+&$text: text that will be returned
'ParserAfterUnstrip': Called after the first unstripGeneral() in
Parser::internalParseHalfParsed()
-$parser: Parser object being used
-$text: text that will be returned
+&$parser: Parser object being used
+&$text: text that will be returned
'ParserBeforeInternalParse': Called at the beginning of Parser::internalParse().
-$parser: Parser object
-$text: text to parse
-$stripState: StripState instance being used
+&$parser: Parser object
+&$text: text to parse
+&$stripState: StripState instance being used
'ParserBeforeStrip': Called at start of parsing time.
TODO: No more strip, deprecated ?
-$parser: parser object
-$text: text being parsed
-$stripState: stripState used (object)
+&$parser: parser object
+&$text: text being parsed
+&$stripState: stripState used (object)
'ParserBeforeTidy': Called before tidy and custom tags replacements.
-$parser: Parser object being used
-$text: actual text
+&$parser: Parser object being used
+&$text: actual text
'ParserCacheSaveComplete': Called after a ParserOutput has been committed to
the parser cache.
$revId: ID of the revision that was parsed to create $parserOutput
'ParserClearState': Called at the end of Parser::clearState().
-$parser: Parser object being cleared
+&$parser: Parser object being cleared
'ParserCloned': Called when the parser is cloned.
$parser: Newly-cloned Parser object
'ParserGetVariableValueSwitch': Called when the parser need the value of a
custom magic word
-$parser: Parser object
-$varCache: array to store the value in case of multiples calls of the
+&$parser: Parser object
+&$varCache: array to store the value in case of multiples calls of the
same magic word
-$index: index (string) of the magic
-$ret: value of the magic word (the hook should set it)
-$frame: PPFrame object to use for expanding any template variables
+&$index: index (string) of the magic
+&$ret: value of the magic word (the hook should set it)
+&$frame: PPFrame object to use for expanding any template variables
'ParserGetVariableValueTs': Use this to change the value of the time for the
{{LOCAL...}} magic word.
-$parser: Parser object
-$time: actual time (timestamp)
+&$parser: Parser object
+&$time: actual time (timestamp)
'ParserGetVariableValueVarCache': use this to change the value of the variable
cache or return false to not use it.
-$parser: Parser object
-$varCache: variable cache (array)
+&$parser: Parser object
+&$varCache: variable cache (array)
'ParserLimitReport': DEPRECATED! Use ParserLimitReportPrepare and
ParserLimitReportFormat instead.
'ParserTestParser': Called when creating a new instance of Parser in
tests/parser/parserTest.inc.
-$parser: Parser object created
+&$parser: Parser object created
'ParserTestTables': Alter the list of tables to duplicate when parser tests are
run. Use when page save hooks require the presence of custom tables to ensure
'PrefixSearchExtractNamespace': Called if core was not able to extract a
namespace from the search string so that extensions can attempt it.
-$namespaces: array of int namespace keys to search in (change this if you can
+&$namespaces: array of int namespace keys to search in (change this if you can
extract namespaces)
-$search: search term (replace this with term without the namespace if you can
+&$search: search term (replace this with term without the namespace if you can
extract one)
'PrefsEmailAudit': Called when user changes their email address.
'ProtectionForm::buildForm': Called after all protection type fieldsets are made
in the form.
$article: the title being (un)protected
-$output: a string of the form HTML so far
+&$output: a string of the form HTML so far
'ProtectionForm::save': Called when a protection form is submitted.
$article: the Page being (un)protected
&$text: The text that's going to be the output
'RecentChange_save': Called at the end of RecentChange::save().
-$recentChange: RecentChange object
+&$recentChange: RecentChange object
'RedirectSpecialArticleRedirectParams': Lets you alter the set of parameter
names such as "oldid" that are preserved when using redirecting special pages
&$text: Text to use for the link
$result: The search result
$terms: The search terms entered
-$page: The SpecialSearch object.
+$page: The SpecialSearch object
+&$query: Query string to be appended to the link
'SidebarBeforeOutput': Allows to edit sidebar just before it is output by skins.
Warning: This hook is run on each display. You should consider to use
&$tpl: QuickTemplate engine object
'SkinTemplatePreventOtherActiveTabs': Use this to prevent showing active tabs.
-$sktemplate: SkinTemplate object
-$res: set to true to prevent active tabs
+&$sktemplate: SkinTemplate object
+&$res: set to true to prevent active tabs
'SkinTemplateTabAction': Override SkinTemplate::tabAction().
You can either create your own array, or alter the parameters for
'SkinTemplateToolboxEnd': Called by SkinTemplate skins after toolbox links have
been rendered (useful for adding more).
-$sk: The QuickTemplate based skin template running the hook.
+&$sk: The QuickTemplate based skin template running the hook.
$dummy: Called when SkinTemplateToolboxEnd is used from a BaseTemplate skin,
extensions that add support for BaseTemplateToolbox should watch for this
dummy parameter with "$dummy=false" in their code and return without echoing
'SoftwareInfo': Called by Special:Version for returning information about the
software.
-$software: The array of software in format 'name' => 'version'. See
+&$software: The array of software in format 'name' => 'version'. See
SpecialVersion::softwareInformation().
'SpecialBlockModifyFormFields': Add more fields to Special:Block
'SpecialListusersDefaultQuery': Called right before the end of
UsersPager::getDefaultQuery().
$pager: The UsersPager instance
-$query: The query array to be returned
+&$query: The query array to be returned
'SpecialListusersFormatRow': Called right before the end of
UsersPager::formatRow().
-$item: HTML to be returned. Will be wrapped in <li></li> after the hook finishes
+&$item: HTML to be returned. Will be wrapped in <li></li> after the hook finishes
$row: Database row object
'SpecialListusersHeader': Called before closing the <fieldset> in
UsersPager::getPageHeader().
$pager: The UsersPager instance
-$out: The header HTML
+&$out: The header HTML
'SpecialListusersHeaderForm': Called before adding the submit button in
UsersPager::getPageHeader().
$pager: The UsersPager instance
-$out: The header HTML
+&$out: The header HTML
'SpecialListusersQueryInfo': Called right before the end of.
UsersPager::getQueryInfo()
$pager: The UsersPager instance
-$query: The query array to be returned
+&$query: The query array to be returned
'SpecialLogAddLogSearchRelations': Add log relations to the current log
$type: String of the log type
&$qc: Array for query conditions to add
'SpecialMovepageAfterMove': Called after moving a page.
-$movePage: MovePageForm object
-$oldTitle: old title (object)
-$newTitle: new title (object)
+&$movePage: MovePageForm object
+&$oldTitle: old title (object)
+&$newTitle: new title (object)
'SpecialNewpagesConditions': Called when building sql query for
Special:NewPages.
'SpecialPage_initList': Called when setting up SpecialPageFactory::$list, use
this hook to remove a core special page or conditionally register special pages.
-$list: list (array) of core special pages
+&$list: list (array) of core special pages
'SpecialPageAfterExecute': Called after SpecialPage::execute.
$special: the SpecialPage object
'SpecialPasswordResetOnSubmit': When executing a form submission on
Special:PasswordReset.
-$users: array of User objects.
+&$users: array of User objects.
$data: array of data submitted by the user
&$error: string, error code (message key) used to describe to error (out
parameter). The hook needs to return false when setting this, otherwise it
'SpecialUploadComplete': Called after successfully uploading a file from
Special:Upload.
-$form: The SpecialUpload object
+&$form: The SpecialUpload object
'SpecialVersionVersionUrl': Called when building the URL for Special:Version.
$wgVersion: Current $wgVersion for you to use
'TitleIsCssOrJsPage': DEPRECATED! Use ContentHandlerDefaultModelFor instead.
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.
+&$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().
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.
+&$result: Boolean; whether MediaWiki currently thinks this page is movable.
Hooks may change this value to override the return value of
Title::isMovable().
Called when determining if a page is a wikitext or should
be handled by separate handler (via ArticleViewCustom).
$title: Title object that is being checked
-$result: Boolean; whether MediaWiki currently thinks this is a wikitext page.
+&$result: Boolean; whether MediaWiki currently thinks this is a wikitext page.
Hooks may change this value to override the return value of
Title::isWikitextPage()
$user: user who does the move
'TitleMoveComplete': After moving an article (title).
-$old: old title
-$nt: new title
-$user: user who did the move
+&$old: old title
+&$nt: new title
+&$user: user who did the move
$pageid: database ID of the page that's been moved
$redirid: database ID of the created redirect
$reason: reason for the move
$article: article "acted on"
'UnwatchArticle': Before a watch is removed from an article.
-$user: user watching
-$page: WikiPage object to be removed
+&$user: user watching
+&$page: WikiPage object to be removed
&$status: Status object to be returned if the hook returns false
'UnwatchArticleComplete': After a watch is removed from an article.
$user: user that watched
-$page: WikiPage object that was watched
+&$page: WikiPage object that was watched
'UpdateUserMailerFormattedPageStatus': Before notification email gets sent.
-$formattedPageStatus: list of valid page states
+&$formattedPageStatus: list of valid page states
'UploadComplete': Upon completion of a file upload.
-$uploadBase: UploadBase (or subclass) object. File can be accessed by
+&$uploadBase: UploadBase (or subclass) object. File can be accessed by
$uploadBase->getLocalFile().
'UploadCreateFromRequest': When UploadBase::createFromRequest has been called.
not use this hook to break upload processing. This will return the user to a
blank form with no error message; use UploadVerification and UploadVerifyFile
instead.
-$form: UploadForm object
+&$form: UploadForm object
'UploadForm:initial': Before the upload form is generated. You might set the
member-variables $uploadFormTextTop and $uploadFormTextAfterSummary to inject
text (HTML) either before or after the editform.
-$form: UploadForm object
+&$form: UploadForm object
'UploadFormInitDescriptor': After the descriptor for the upload form as been
assembled.
-$descriptor: (array) the HTMLForm descriptor
+&$descriptor: (array) the HTMLForm descriptor
'UploadFormSourceDescriptors': after the standard source inputs have been
added to the descriptor
'User::mailPasswordInternal': before creation and mailing of a user's new
temporary password
-$user: the user who sent the message out
-$ip: IP of the user who sent the message out
-$u: the account whose new password will be set
+&$user: the user who sent the message out
+&$ip: IP of the user who sent the message out
+&$u: the account whose new password will be set
'UserAddGroup': Called when adding a group; return false to override
stock group addition.
'userCan': To interrupt/advise the "user can do X to Y article" check. If you
want to display an error message, try getUserPermissionsErrors.
-$title: Title object being checked against
-$user: Current user object
+&$title: Title object being checked against
+&$user: Current user object
$action: Action being checked
-$result: Pointer to result returned if hook returns false. If null is returned,
+&$result: Pointer to result returned if hook returns false. If null is returned,
userCan checks are continued by internal code.
'UserCanSendEmail': To override User::canSendEmail() permission check.
-$user: User (object) whose permission is being checked
+&$user: User (object) whose permission is being checked
&$canSend: bool set on input, can override on output
'UserClearNewTalkNotification': Called when clearing the "You have new
messages!" message, return false to not delete it.
-$user: User (object) that will clear the message
+&$user: User (object) that will clear the message
$oldid: ID of the talk page revision being viewed (0 means the most recent one)
'UserCreateForm': change to manipulate the login form
-$template: SimpleTemplate instance for the form
+&$template: SimpleTemplate instance for the form
'UserEffectiveGroups': Called in User::getEffectiveGroups().
-$user: User to get groups for
+&$user: User to get groups for
&$groups: Current effective groups
'UserGetAllRights': After calculating a list of all available rights.
$user: User object for the logged-in user
'UserLoginComplete': After a user has logged in.
-$user: the user object that was created on login
-$inject_html: Any HTML to inject after the "logged in" message.
+&$user: the user object that was created on login
+&$inject_html: Any HTML to inject after the "logged in" message.
'UserLoginForm': change to manipulate the login form
-$template: SimpleTemplate instance for the form
+&$template: SimpleTemplate instance for the form
'UserLogout': Before a user logs out.
-$user: the user object that is about to be logged out
+&$user: the user object that is about to be logged out
'UserLogoutComplete': After a user has logged out.
-$user: the user object _after_ logout (won't have name, ID, etc.)
-$inject_html: Any HTML to inject after the "logged out" message.
+&$user: the user object _after_ logout (won't have name, ID, etc.)
+&$inject_html: Any HTML to inject after the "logged out" message.
$oldName: name of the user before logout (string)
'UserMailerChangeReturnPath': Called to generate a VERP return address
'UserMailerSplitTo': Called in UserMailer::send() to give extensions a chance
to split up an email with multiple the To: field into separate emails.
-$to: array of MailAddress objects; unset the ones which should be mailed separately
+&$to: array of MailAddress objects; unset the ones which should be mailed separately
'UserMailerTransformContent': Called in UserMailer::send() to change email contents.
Extensions can block sending the email by returning false and setting $error.
'UserRetrieveNewTalks': Called when retrieving "You have new messages!"
message(s).
-$user: user retrieving new talks messages
-$talks: array of new talks page(s)
+&$user: user retrieving new talks messages
+&$talks: array of new talks page(s)
'UserRights': DEPRECATED! Use UserGroupsChanged instead.
After a user's group memberships are changed.
&$query: query array, see QueryPage::getQueryInfo() for format documentation
'WatchArticle': Before a watch is added to an article.
-$user: user that will watch
-$page: WikiPage object to be watched
+&$user: user that will watch
+&$page: WikiPage object to be watched
&$status: Status object to be returned if the hook returns false
'WatchArticleComplete': After a watch is added to an article.
-$user: user that watched
-$page: WikiPage object watched
+&$user: user that watched
+&$page: WikiPage object watched
'WatchlistEditorBeforeFormRender': Before building the Special:EditWatchlist
form, used to manipulate the list of pages or preload data based on that list.
'wgQueryPages': Called when initialising list of QueryPage subclasses, use this
to add new query pages to be updated with maintenance/updateSpecialPages.php.
-$qp: The list of QueryPages
+&$qp: The list of QueryPages
'WhatLinksHereProps': Allows annotations to be added to WhatLinksHere
$row: The DB row of the entry.
'XmlDumpWriterWriteRevision': Called at the end of a revision in an XML dump, to
add extra metadata.
-$obj: The XmlDumpWriter object.
+&$obj: The XmlDumpWriter object.
&$out: The text being output.
$row: The database row for the revision.
$text: The revision text.