Documentation updates for r83371
[lhc/web/wiklou.git] / docs / hooks.txt
1 hooks.txt
2
3 This document describes how event hooks work in MediaWiki; how to add hooks for
4 an event; and how to run hooks for an event.
5
6 ==Glossary==
7
8 event
9 Something that happens with the wiki. For example: a user logs in. A wiki
10 page is saved. A wiki page is deleted. Often there are two events
11 associated with a single action: one before the code is run to make the
12 event happen, and one after. Each event has a name, preferably in
13 CamelCase. For example, 'UserLogin', 'ArticleSave', 'ArticleSaveComplete',
14 'ArticleDelete'.
15
16 hook
17 A clump of code and data that should be run when an event happens. This can
18 be either a function and a chunk of data, or an object and a method.
19
20 hook function
21 The function part of a hook.
22
23 ==Rationale==
24
25 Hooks allow us to decouple optionally-run code from code that is run for
26 everyone. It allows MediaWiki hackers, third-party developers and local
27 administrators to define code that will be run at certain points in the mainline
28 code, and to modify the data run by that mainline code. Hooks can keep mainline
29 code simple, and make it easier to write extensions. Hooks are a principled
30 alternative to local patches.
31
32 Consider, for example, two options in MediaWiki. One reverses the order of a
33 title before displaying the article; the other converts the title to all
34 uppercase letters. Currently, in MediaWiki code, we would handle this as follows
35 (note: not real code, here):
36
37 function showAnArticle($article) {
38 global $wgReverseTitle, $wgCapitalizeTitle;
39
40 if ($wgReverseTitle) {
41 wfReverseTitle($article);
42 }
43
44 if ($wgCapitalizeTitle) {
45 wfCapitalizeTitle($article);
46 }
47
48 # code to actually show the article goes here
49 }
50
51 An extension writer, or a local admin, will often add custom code to the
52 function -- with or without a global variable. For example, someone wanting
53 email notification when an article is shown may add:
54
55 function showAnArticle($article) {
56 global $wgReverseTitle, $wgCapitalizeTitle, $wgNotifyArticle;
57
58 if ($wgReverseTitle) {
59 wfReverseTitle($article);
60 }
61
62 if ($wgCapitalizeTitle) {
63 wfCapitalizeTitle($article);
64 }
65
66 # code to actually show the article goes here
67
68 if ($wgNotifyArticle) {
69 wfNotifyArticleShow($article));
70 }
71 }
72
73 Using a hook-running strategy, we can avoid having all this option-specific
74 stuff in our mainline code. Using hooks, the function becomes:
75
76 function showAnArticle($article) {
77
78 if (wfRunHooks('ArticleShow', array(&$article))) {
79
80 # code to actually show the article goes here
81
82 wfRunHooks('ArticleShowComplete', array(&$article));
83 }
84 }
85
86 We've cleaned up the code here by removing clumps of weird, infrequently used
87 code and moving them off somewhere else. It's much easier for someone working
88 with this code to see what's _really_ going on, and make changes or fix bugs.
89
90 In addition, we can take all the code that deals with the little-used
91 title-reversing options (say) and put it in one place. Instead of having little
92 title-reversing if-blocks spread all over the codebase in showAnArticle,
93 deleteAnArticle, exportArticle, etc., we can concentrate it all in an extension
94 file:
95
96 function reverseArticleTitle($article) {
97 # ...
98 }
99
100 function reverseForExport($article) {
101 # ...
102 }
103
104 The setup function for the extension just has to add its hook functions to the
105 appropriate events:
106
107 setupTitleReversingExtension() {
108 global $wgHooks;
109
110 $wgHooks['ArticleShow'][] = 'reverseArticleTitle';
111 $wgHooks['ArticleDelete'][] = 'reverseArticleTitle';
112 $wgHooks['ArticleExport'][] = 'reverseForExport';
113 }
114
115 Having all this code related to the title-reversion option in one place means
116 that it's easier to read and understand; you don't have to do a grep-find to see
117 where the $wgReverseTitle variable is used, say.
118
119 If the code is well enough isolated, it can even be excluded when not used --
120 making for some slight savings in memory and load-up performance at runtime.
121 Admins who want to have all the reversed titles can add:
122
123 require_once('extensions/ReverseTitle.php');
124
125 ...to their LocalSettings.php file; those of us who don't want or need it can
126 just leave it out.
127
128 The extensions don't even have to be shipped with MediaWiki; they could be
129 provided by a third-party developer or written by the admin him/herself.
130
131 ==Writing hooks==
132
133 A hook is a chunk of code run at some particular event. It consists of:
134
135 * a function with some optional accompanying data, or
136 * an object with a method and some optional accompanying data.
137
138 Hooks are registered by adding them to the global $wgHooks array for a given
139 event. All the following are valid ways to define hooks:
140
141 $wgHooks['EventName'][] = 'someFunction'; # function, no data
142 $wgHooks['EventName'][] = array('someFunction', $someData);
143 $wgHooks['EventName'][] = array('someFunction'); # weird, but OK
144
145 $wgHooks['EventName'][] = $object; # object only
146 $wgHooks['EventName'][] = array($object, 'someMethod');
147 $wgHooks['EventName'][] = array($object, 'someMethod', $someData);
148 $wgHooks['EventName'][] = array($object); # weird but OK
149
150 When an event occurs, the function (or object method) will be called with the
151 optional data provided as well as event-specific parameters. The above examples
152 would result in the following code being executed when 'EventName' happened:
153
154 # function, no data
155 someFunction($param1, $param2)
156 # function with data
157 someFunction($someData, $param1, $param2)
158
159 # object only
160 $object->onEventName($param1, $param2)
161 # object with method
162 $object->someMethod($param1, $param2)
163 # object with method and data
164 $object->someMethod($someData, $param1, $param2)
165
166 Note that when an object is the hook, and there's no specified method, the
167 default method called is 'onEventName'. For different events this would be
168 different: 'onArticleSave', 'onUserLogin', etc.
169
170 The extra data is useful if we want to use the same function or object for
171 different purposes. For example:
172
173 $wgHooks['ArticleSaveComplete'][] = array('ircNotify', 'TimStarling');
174 $wgHooks['ArticleSaveComplete'][] = array('ircNotify', 'brion');
175
176 This code would result in ircNotify being run twice when an article is saved:
177 once for 'TimStarling', and once for 'brion'.
178
179 Hooks can return three possible values:
180
181 * true: the hook has operated successfully
182 * "some string": an error occurred; processing should stop and the error
183 should be shown to the user
184 * false: the hook has successfully done the work necessary and the calling
185 function should skip
186
187 The last result would be for cases where the hook function replaces the main
188 functionality. For example, if you wanted to authenticate users to a custom
189 system (LDAP, another PHP program, whatever), you could do:
190
191 $wgHooks['UserLogin'][] = array('ldapLogin', $ldapServer);
192
193 function ldapLogin($username, $password) {
194 # log user into LDAP
195 return false;
196 }
197
198 Returning false makes less sense for events where the action is complete, and
199 will normally be ignored.
200
201 Note that none of the examples made use of create_function() as a way to
202 attach a function to a hook. This is known to cause problems (notably with
203 Special:Version), and should be avoided when at all possible.
204
205 ==Using hooks==
206
207 A calling function or method uses the wfRunHooks() function to run the hooks
208 related to a particular event, like so:
209
210 class Article {
211 # ...
212 function protect() {
213 global $wgUser;
214 if (wfRunHooks('ArticleProtect', array(&$this, &$wgUser))) {
215 # protect the article
216 wfRunHooks('ArticleProtectComplete', array(&$this, &$wgUser));
217 }
218 }
219 }
220
221 wfRunHooks() returns true if the calling function should continue processing
222 (the hooks ran OK, or there are no hooks to run), or false if it shouldn't (an
223 error occurred, or one of the hooks handled the action already). Checking the
224 return value matters more for "before" hooks than for "complete" hooks.
225
226 Note that hook parameters are passed in an array; this is a necessary
227 inconvenience to make it possible to pass reference values (that can be changed)
228 into the hook code. Also note that earlier versions of wfRunHooks took a
229 variable number of arguments; the array() calling protocol came about after
230 MediaWiki 1.4rc1.
231
232 ==Events and parameters==
233
234 This is a list of known events and parameters; please add to it if you're going
235 to add events to the MediaWiki code.
236
237 'AbortAutoblock': Return false to cancel an autoblock.
238 $autoblockip: The IP going to be autoblocked.
239 $block: The block from which the autoblock is coming.
240
241 'AbortDiffCache': Can be used to cancel the caching of a diff
242 &$diffEngine: DifferenceEngine object
243
244 'AbortLogin': Return false to cancel account login.
245 $user: the User object being authenticated against
246 $password: the password being submitted, not yet checked for validity
247 &$retval: a LoginForm class constant to return from authenticateUserData();
248 default is LoginForm::ABORTED. Note that the client may be using
249 a machine API rather than the HTML user interface.
250 &$msg: the message identifier for abort reason (new in 1.18, not available before 1.18)
251
252 'AbortMove': allows to abort moving an article (title)
253 $old: old title
254 $nt: new title
255 $user: user who is doing the move
256 $err: error message
257 $reason: the reason for the move (added in 1.13)
258
259 'AbortNewAccount': Return false to cancel account creation.
260 $user: the User object about to be created (read-only, incomplete)
261 $message: out parameter: error message to display on abort
262
263 'AddNewAccount': after a user account is created
264 $user: the User object that was created. (Parameter added in 1.7)
265 $byEmail: true when account was created "by email" (added in 1.12)
266
267 'AfterImportPage': When a page import is completed
268 $title: Title under which the revisions were imported
269 $origTitle: Title provided by the XML file
270 $revCount: Number of revisions in the XML file
271 $sRevCount: Number of sucessfully imported revisions
272 $pageInfo: associative array of page information
273
274 'AfterUserMessage': After a user message has been left, this hook is
275 called to take care of any cleanup.
276 $user: The user who we left the message for.
277 $article: The article the message was left on.
278 $subject: The subject of the message
279 $text: The text of the message.
280 $signature: The signature we used.
281 $summary: The edit summary.
282 $editor: The editor that performed the edit.
283
284 'AjaxAddScript': Called in output page just before the initialisation
285 of the javascript ajax engine. The hook is only called when ajax
286 is enabled ( $wgUseAjax = true; ).
287
288 'AlternateEdit': before checking if an user can edit a page and
289 before showing the edit form ( EditPage::edit() ). This is triggered
290 on &action=edit.
291 $EditPage: the EditPage object
292
293 'APIAfterExecute': after calling the execute() method of an API module.
294 Use this to extend core API modules.
295 &$module: Module object
296
297 'APIEditBeforeSave': before saving a page with api.php?action=edit,
298 after processing request parameters. Return false to let the request
299 fail, returning an error message or an <edit result="Failure"> tag
300 if $resultArr was filled.
301 $EditPage : the EditPage object
302 $text : the new text of the article (has yet to be saved)
303 &$resultArr : data in this array will be added to the API result
304
305 'APIGetAllowedParams': use this hook to modify a module's parameters.
306 &$module: Module object
307 &$params: Array of parameters
308
309 'APIGetParamDescription': use this hook to modify a module's parameter
310 descriptions.
311 &$module: Module object
312 &$desc: Array of parameter descriptions
313
314 'APIQueryAfterExecute': after calling the execute() method of an
315 action=query submodule. Use this to extend core API modules.
316 &$module: Module object
317
318 'APIQueryGeneratorAfterExecute': after calling the executeGenerator()
319 method of an action=query submodule. Use this to extend core API modules.
320 &$module: Module object
321 &$resultPageSet: ApiPageSet object
322
323 'APIQueryInfoTokens': use this hook to add custom tokens to prop=info.
324 Every token has an action, which will be used in the intoken parameter
325 and in the output (actiontoken="..."), and a callback function which
326 should return the token, or false if the user isn't allowed to obtain
327 it. The prototype of the callback function is func($pageid, $title)
328 where $pageid is the page ID of the page the token is requested for
329 and $title is the associated Title object. In the hook, just add
330 your callback to the $tokenFunctions array and return true (returning
331 false makes no sense)
332 $tokenFunctions: array(action => callback)
333
334 'APIQueryRevisionsTokens': use this hook to add custom tokens to prop=revisions.
335 Every token has an action, which will be used in the rvtoken parameter
336 and in the output (actiontoken="..."), and a callback function which
337 should return the token, or false if the user isn't allowed to obtain
338 it. The prototype of the callback function is func($pageid, $title, $rev)
339 where $pageid is the page ID of the page associated to the revision the
340 token is requested for, $title the associated Title object and $rev the
341 associated Revision object. In the hook, just add your callback to the
342 $tokenFunctions array and return true (returning false makes no sense)
343 $tokenFunctions: array(action => callback)
344
345 'APIQueryRecentChangesTokens': use this hook to add custom tokens to
346 list=recentchanges.
347 Every token has an action, which will be used in the rctoken parameter
348 and in the output (actiontoken="..."), and a callback function which
349 should return the token, or false if the user isn't allowed to obtain
350 it. The prototype of the callback function is func($pageid, $title, $rc)
351 where $pageid is the page ID of the page associated to the revision the
352 token is requested for, $title the associated Title object and $rc the
353 associated RecentChange object. In the hook, just add your callback to the
354 $tokenFunctions array and return true (returning false makes no sense)
355 $tokenFunctions: array(action => callback)
356
357 'APIQueryUsersTokens': use this hook to add custom token to list=users.
358 Every token has an action, which will be used in the ustoken parameter
359 and in the output (actiontoken="..."), and a callback function which
360 should return the token, or false if the user isn't allowed to obtain
361 it. The prototype of the callback function is func($user) where $user
362 is the User object. In the hook, just add your callback to the
363 $tokenFunctions array and return true (returning false makes no sense)
364 $tokenFunctions: array(action => callback)
365
366 'ApiRsdServiceApis': Add or remove APIs from the RSD services list.
367 Each service should have its own entry in the $apis array and have a
368 unique name, passed as key for the array that represents the service data.
369 In this data array, the key-value-pair identified by the apiLink key is
370 required.
371 &$apis: array of services
372
373 'ArticleAfterFetchContent': after fetching content of an article from
374 the database
375 $article: the article (object) being loaded from the database
376 $content: the content (string) of the article
377
378 'ArticleConfirmDelete': before writing the confirmation form for article
379 deletion
380 $article: the article (object) being deleted
381 $output: the OutputPage object ($wgOut)
382 &$reason: the reason (string) the article is being deleted
383
384 'ArticleContentOnDiff': before showing the article content below a diff.
385 Use this to change the content in this area or how it is loaded.
386 $diffEngine: the DifferenceEngine
387 $output: the OutputPage object ($wgOut)
388
389 'ArticleDelete': before an article is deleted
390 $article: the article (object) being deleted
391 $user: the user (object) deleting the article
392 $reason: the reason (string) the article is being deleted
393 $error: if the deletion was prohibited, the (raw HTML) error message to display
394 (added in 1.13)
395
396 'ArticleDeleteComplete': after an article is deleted
397 $article: the article that was deleted
398 $user: the user that deleted the article
399 $reason: the reason the article was deleted
400 $id: id of the article that was deleted
401
402 'ArticleEditUpdateNewTalk': before updating user_newtalk when a user talk page
403 was changed
404 $article: article (object) of the user talk page
405
406 'ArticleEditUpdates': when edit updates (mainly link tracking) are made when an
407 article has been changed
408 $article: the article (object)
409 $editInfo: data holder that includes the parser output ($editInfo->output) for
410 that page after the change
411 $changed: bool for if the page was changed
412
413 'ArticleEditUpdatesDeleteFromRecentchanges': before deleting old entries from
414 recentchanges table, return false to not delete old entries
415 $article: article (object) being modified
416
417 'ArticleFromTitle': when creating an article object from a title object using
418 Wiki::articleFromTitle()
419 $title: title (object) used to create the article object
420 $article: article (object) that will be returned
421
422 'ArticleInsertComplete': After a new article is created
423 $article: Article created
424 $user: User creating the article
425 $text: New content
426 $summary: Edit summary/comment
427 $isMinor: Whether or not the edit was marked as minor
428 $isWatch: (No longer used)
429 $section: (No longer used)
430 $flags: Flags passed to Article::doEdit()
431 $revision: New Revision of the article
432
433 'ArticleMergeComplete': after merging to article using Special:Mergehistory
434 $targetTitle: target title (object)
435 $destTitle: destination title (object)
436
437 'ArticlePageDataAfter': after loading data of an article from the database
438 $article: article (object) whose data were loaded
439 $row: row (object) returned from the database server
440
441 'ArticlePageDataBefore': before loading data of an article from the database
442 $article: article (object) that data will be loaded
443 $fields: fileds (array) to load from the database
444
445 'ArticlePrepareTextForEdit': called when preparing text to be saved
446 $article: the article being saved
447 $popts: parser options to be used for pre-save transformation
448
449 'ArticleProtect': before an article is protected
450 $article: the article being protected
451 $user: the user doing the protection
452 $protect: boolean whether this is a protect or an unprotect
453 $reason: Reason for protect
454 $moveonly: boolean whether this is for move only or not
455
456 'ArticleProtectComplete': after an article is protected
457 $article: the article that was protected
458 $user: the user who did the protection
459 $protect: boolean whether it was a protect or an unprotect
460 $reason: Reason for protect
461 $moveonly: boolean whether it was for move only or not
462
463 'ArticlePurge': before executing "&action=purge"
464 $article: article (object) to purge
465
466 'ArticleRevisionVisibilitySet': called when changing visibility of one or more
467 revision of an article
468 &$title: title object of the article
469
470 'ArticleRevisionUndeleted': after an article revision is restored
471 $title: the article title
472 $revision: the revision
473 $oldPageID: the page ID of the revision when archived (may be null)
474
475 'ArticleRollbackComplete': after an article rollback is completed
476 $article: the article that was edited
477 $user: the user who did the rollback
478 $revision: the revision the page was reverted back to
479 $current: the reverted revision
480
481 'ArticleSave': before an article is saved
482 $article: the article (object) being saved
483 $user: the user (object) saving the article
484 $text: the new article text
485 $summary: the article summary (comment)
486 $isminor: minor flag
487 $iswatch: watch flag
488 $section: section #
489
490 'ArticleSaveComplete': After an article has been updated
491 $article: Article modified
492 $user: User performing the modification
493 $text: New content
494 $summary: Edit summary/comment
495 $isMinor: Whether or not the edit was marked as minor
496 $isWatch: (No longer used)
497 $section: (No longer used)
498 $flags: Flags passed to Article::doEdit()
499 $revision: New Revision of the article
500 $baseRevId: the rev ID (or false) this edit was based on
501
502 'ArticleUndelete': When one or more revisions of an article are restored
503 $title: Title corresponding to the article restored
504 $create: Whether or not the restoration caused the page to be created
505 (i.e. it didn't exist before)
506 $comment: The comment associated with the undeletion.
507
508 'ArticleUpdateBeforeRedirect': After a page is updated (usually on save),
509 before the user is redirected back to the page
510 &$article: the article
511 &$sectionanchor: The section anchor link (e.g. "#overview" )
512 &$extraq: Extra query parameters which can be added via hooked functions
513
514 'ArticleViewFooter': After showing the footer section of an ordinary page view
515 $article: Article object
516
517 'ArticleViewHeader': Before the parser cache is about to be tried for article
518 viewing.
519 &$article: the article
520 &$pcache: whether to try the parser cache or not
521 &$outputDone: whether the output for this page finished or not
522
523 'ArticleViewRedirect': before setting "Redirected from ..." subtitle when
524 follwed an redirect
525 $article: target article (object)
526
527 'AuthPluginAutoCreate': Called when creating a local account for an user logged
528 in from an external authentication method
529 $user: User object created locally
530
531 'AuthPluginSetup': update or replace authentication plugin object ($wgAuth)
532 Gives a chance for an extension to set it programattically to a variable class.
533 &$auth: the $wgAuth object, probably a stub
534
535 'AutopromoteCondition': check autopromote condition for user.
536 $type: condition type
537 $args: arguments
538 $user: user
539 $result: result of checking autopromote condition
540
541 'BadImage': When checking against the bad image list
542 $name: Image name being checked
543 &$bad: Whether or not the image is "bad"
544
545 Change $bad and return false to override. If an image is "bad", it is not
546 rendered inline in wiki pages or galleries in category pages.
547
548 'BeforeGalleryFindFile': before an image is fetched for a gallery
549 &$gallery,: the gallery object
550 &$nt: the image title
551 &$time: image timestamp
552
553 'BeforeInitialize': before anything is initialized in performRequestForTitle()
554 &$title: Title being used for request
555 &$article: The associated Article object
556 &$output: OutputPage object
557 &$user: User
558 $request: WebRequest object
559 $mediaWiki: Mediawiki object
560
561 'BeforePageDisplay': Prior to outputting a page
562 &$out: OutputPage object
563 &$skin: Skin object
564
565 'BeforeParserFetchTemplateAndtitle': before a template is fetched by Parser
566 &$parser: Parser object
567 &$title: title of the template
568 &$skip: skip this template and link it?
569 &$id: the id of the revision being parsed
570
571 'BeforeParserMakeImageLinkObj': before an image is rendered by Parser
572 &$parser: Parser object
573 &$nt: the image title
574 &$skip: skip this image and link it?
575 &$time: the image timestamp
576
577 'BeforeParserrenderImageGallery': before an image gallery is rendered by Parser
578 &$parser: Parser object
579 &$ig: ImageGallery object
580
581 'BlockIp': before an IP address or user is blocked
582 $block: the Block object about to be saved
583 $user: the user _doing_ the block (not the one being blocked)
584
585 'BlockIpComplete': after an IP address or user is blocked
586 $block: the Block object that was saved
587 $user: the user who did the block (not the one being blocked)
588
589 'BookInformation': Before information output on Special:Booksources
590 $isbn: ISBN to show information for
591 $output: OutputPage object in use
592
593 'CanonicalNamespaces': For extensions adding their own namespaces or altering the defaults
594 &$namespaces: Array of namespace numbers with corresponding canonical names
595
596 'CategoryPageView': before viewing a categorypage in CategoryPage::view
597 $catpage: CategoryPage instance
598
599 'ChangesListInsertArticleLink': Override or augment link to article in RC list.
600 &$changesList: ChangesList instance.
601 &$articlelink: HTML of link to article (already filled-in).
602 &$s: HTML of row that is being constructed.
603 &$rc: RecentChange instance.
604 $unpatrolled: Whether or not we are showing unpatrolled changes.
605 $watched: Whether or not the change is watched by the user.
606
607 'ConfirmEmailComplete': Called after a user's email has been confirmed successfully
608 $user: user (object) whose email is being confirmed
609
610 'ContribsPager::getQueryInfo': Before the contributions query is about to run
611 &$pager: Pager object for contributions
612 &queryInfo: The query for the contribs Pager
613
614 'ContributionsLineEnding': Called before a contributions HTML line is finished
615 $page: SpecialPage object for contributions
616 $ret: the HTML line
617 $row: the DB row for this line
618
619 'ContributionsToolLinks': Change tool links above Special:Contributions
620 $id: User identifier
621 $title: User page title
622 &$tools: Array of tool links
623
624 'CustomEditor': When invoking the page editor
625 $article: Article being edited
626 $user: User performing the edit
627
628 Return true to allow the normal editor to be used, or false
629 if implementing a custom editor, e.g. for a special namespace,
630 etc.
631
632 'DatabaseOraclePostInit': Called after initialising an Oracle database
633 &$db: the DatabaseOracle object
634
635 'NewDifferenceEngine': Called when a new DifferenceEngine object is made
636 $title: the diff page title (nullable)
637 &$oldId: the actual old Id to use in the diff
638 &$newId: the actual new Id to use in the diff (0 means current)
639 $old: the ?old= param value from the url
640 $new: the ?new= param value from the url
641
642 'DiffViewHeader': called before diff display
643 $diff: DifferenceEngine object that's calling
644 $oldRev: Revision object of the "old" revision (may be null/invalid)
645 $newRev: Revision object of the "new" revision
646
647 'DisplayOldSubtitle': before creating subtitle when browsing old versions of
648 an article
649 $article: article (object) being viewed
650 $oldid: oldid (int) being viewed
651
652 'DoEditSectionLink': Override the HTML generated for section edit links
653 $skin: Skin object rendering the UI
654 $title: Title object for the title being linked to (may not be the same as
655 $wgTitle, if the section is included from a template)
656 $section: The designation of the section being pointed to, to be included in
657 the link, like "&section=$section"
658 $tooltip: The default tooltip. Escape with htmlspecialchars() before using.
659 By default, this is wrapped in the 'editsectionhint' message.
660 &$result: The HTML to return, prefilled with the default plus whatever other
661 changes earlier hooks have made
662 $lang: The language code to use for the link in the wfMsg* functions
663
664 'EditFilter': Perform checks on an edit
665 $editor: Edit form (see includes/EditPage.php)
666 $text: Contents of the edit box
667 $section: Section being edited
668 &$error: Error message to return
669 $summary: Edit summary for page
670
671 'EditFilterMerged': Post-section-merge edit filter
672 $editor: EditPage instance (object)
673 $text: content of the edit box
674 &$error: error message to return
675 $summary: Edit summary for page
676
677 'EditFormPreloadText': Allows population of the edit form when creating
678 new pages
679 &$text: Text to preload with
680 &$title: Title object representing the page being created
681
682 'EditFormInitialText': Allows modifying the edit form when editing existing
683 pages
684 $editPage: EditPage object
685
686 'EditPage::attemptSave': called before an article is
687 saved, that is before insertNewArticle() is called
688 $editpage_Obj: the current EditPage object
689
690 'EditPage::importFormData': allow extensions to read additional data
691 posted in the form
692 $editpage: EditPage instance
693 $request: Webrequest
694 return value is ignored (should always return true)
695
696 'EditPage::showEditForm:fields': allows injection of form field into edit form
697 &$editor: the EditPage instance for reference
698 &$out: an OutputPage instance to write to
699 return value is ignored (should always return true)
700
701 'EditPage::showEditForm:initial': before showing the edit form
702 $editor: EditPage instance (object)
703
704 Return false to halt editing; you'll need to handle error messages, etc.
705 yourself. Alternatively, modifying $error and returning true will cause the
706 contents of $error to be echoed at the top of the edit form as wikitext.
707 Return true without altering $error to allow the edit to proceed.
708
709 'EditPageBeforeConflictDiff': allows modifying the EditPage object and output
710 when there's an edit conflict. Return false to halt normal diff output; in
711 this case you're responsible for computing and outputting the entire "conflict"
712 part, i.e., the "difference between revisions" and "your text" headers and
713 sections.
714 &$editor: EditPage instance
715 &$out: OutputPage instance
716
717 'EditPageBeforeEditButtons': allows modifying the edit buttons below the
718 textarea in the edit form
719 &$editpage: The current EditPage object
720 &$buttons: Array of edit buttons "Save", "Preview", "Live", and "Diff"
721 &$tabindex: HTML tabindex of the last edit check/button
722
723 'EditPageBeforeEditChecks': allows modifying the edit checks below the
724 textarea in the edit form
725 &$editpage: The current EditPage object
726 &$checks: Array of edit checks like "watch this page"/"minor edit"
727 &$tabindex: HTML tabindex of the last edit check/button
728
729 'EditPageBeforeEditToolbar': allows modifying the edit toolbar above the
730 textarea in the edit form
731 &$toolbar: The toolbar HTMl
732
733 'EditPageCopyrightWarning': Allow for site and per-namespace customization of contribution/copyright notice.
734 $title: title of page being edited
735 &$msg: localization message name, overridable. Default is either 'copyrightwarning' or 'copyrightwarning2'
736
737 'EditPageGetDiffText': Allow modifying the wikitext that will be used in
738 "Show changes"
739 $editPage: EditPage object
740 &$newtext: wikitext that will be used as "your version"
741
742 'EditPageGetPreviewText': Allow modifying the wikitext that will be previewed
743 $editPage: EditPage object
744 &$toparse: wikitext that will be parsed
745
746 'EditPageNoSuchSection': When a section edit request is given for an non-existent section
747 &$editpage: The current EditPage object
748 &$res: the HTML of the error text
749
750 'EditPageTosSummary': Give a chance for site and per-namespace customizations
751 of terms of service summary link that might exist separately from the copyright
752 notice.
753 $title: title of page being edited
754 &$msg: localization message name, overridable. Default is 'editpage-tos-summary'
755
756 'EditSectionLink': Do not use, use DoEditSectionLink instead.
757 $skin: Skin rendering the UI
758 $title: Title being linked to
759 $section: Section to link to
760 $link: Default link
761 &$result: Result (alter this to override the generated links)
762 $lang: The language code to use for the link in the wfMsg* functions
763
764 'EmailConfirmed': When checking that the user's email address is "confirmed"
765 $user: User being checked
766 $confirmed: Whether or not the email address is confirmed
767 This runs before the other checks, such as anonymity and the real check; return
768 true to allow those checks to occur, and false if checking is done.
769
770 'EmailUser': before sending email from one user to another
771 $to: address of receiving user
772 $from: address of sending user
773 $subject: subject of the mail
774 $text: text of the mail
775
776 'EmailUserCC': before sending the copy of the email to the author
777 $to: address of receiving user
778 $from: address of sending user
779 $subject: subject of the mail
780 $text: text of the mail
781
782 'EmailUserComplete': after sending email from one user to another
783 $to: address of receiving user
784 $from: address of sending user
785 $subject: subject of the mail
786 $text: text of the mail
787
788 'EmailUserForm': after building the email user form object
789 $form: HTMLForm object
790
791 'EmailUserPermissionsErrors': to retrieve permissions errors for emailing a user.
792 $user: The user who is trying to email another user.
793 $editToken: The user's edit token.
794 &$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage.
795
796 'FetchChangesList': When fetching the ChangesList derivative for
797 a particular user
798 &$user: User the list is being fetched for
799 &$skin: Skin object to be used with the list
800 &$list: List object (defaults to NULL, change it to an object
801 instance and return false override the list derivative used)
802
803 'FileDeleteComplete': When a file is deleted
804 $file: reference to the deleted file
805 $oldimage: in case of the deletion of an old image, the name of the old file
806 $article: in case all revisions of the file are deleted a reference to the
807 article associated with the file.
808 $user: user who performed the deletion
809 $reason: reason
810
811 'FileUpload': When a file upload occurs
812 $file : Image object representing the file that was uploaded
813 $reupload : Boolean indicating if there was a previously another image there or not (since 1.17)
814 $hasDescription : Boolean indicating that there was already a description page and a new one from the comment wasn't created (since 1.17)
815
816 'FileUndeleteComplete': When a file is undeleted
817 $title: title object to the file
818 $fileVersions: array of undeleted versions. Empty if all versions were restored
819 $user: user who performed the undeletion
820 $reason: reason
821
822 'FormatUserMessage': Hook to format a message if you want to override
823 the internal formatter.
824 $subject: Title of the message.
825 &$text: Text of the message.
826 $signature: Signature that they would like to leave.
827
828 'GetAutoPromoteGroups': When determining which autopromote groups a user
829 is entitled to be in.
830 &$user: user to promote.
831 &$promote: groups that will be added.
832
833 'GetBlockedStatus': after loading blocking status of an user from the database
834 $user: user (object) being checked
835
836 'GetCacheVaryCookies': get cookies that should vary cache options
837 $out: OutputPage object
838 &$cookies: array of cookies name, add a value to it if you want to add a cookie
839 that have to vary cache options
840
841 'GetFullURL': modify fully-qualified URLs used in redirects/export/offsite data
842 $title: Title object of page
843 $url: string value as output (out parameter, can modify)
844 $query: query options passed to Title::getFullURL()
845
846 'GetInternalURL': modify fully-qualified URLs used for squid cache purging
847 $title: Title object of page
848 $url: string value as output (out parameter, can modify)
849 $query: query options passed to Title::getInternalURL()
850
851 'GetIP': modify the ip of the current user (called only once)
852 &$ip: string holding the ip as determined so far
853
854 'GetLinkColours': modify the CSS class of an array of page links
855 $linkcolour_ids: array of prefixed DB keys of the pages linked to,
856 indexed by page_id.
857 &$colours: (output) array of CSS classes, indexed by prefixed DB keys
858
859 'GetLocalURL': modify local URLs as output into page links
860 $title: Title object of page
861 $url: string value as output (out parameter, can modify)
862 $query: query options passed to Title::getLocalURL()
863
864 'GetPreferences': modify user preferences
865 $user: User whose preferences are being modified.
866 &$preferences: Preferences description array, to be fed to an HTMLForm object
867
868 'getUserPermissionsErrors': Add a permissions error when permissions errors are
869 checked for. Use instead of userCan for most cases. Return false if the
870 user can't do it, and populate $result with the reason in the form of
871 array( messagename, param1, param2, ... ). For consistency, error messages
872 should be plain text with no special coloring, bolding, etc. to show that
873 they're errors; presenting them properly to the user as errors is done by
874 the caller.
875 $title: Title object being checked against
876 $user : Current user object
877 $action: Action being checked
878 $result: User permissions error to add. If none, return true.
879
880 'getUserPermissionsErrorsExpensive': Absolutely the same, but is called only
881 if expensive checks are enabled.
882
883 'ImageBeforeProduceHTML': Called before producing the HTML created by a wiki
884 image insertion. You can skip the default logic entirely by returning
885 false, or just modify a few things using call-by-reference.
886 &$skin: Skin object
887 &$title: Title object of the image
888 &$file: File object, or false if it doesn't exist
889 &$frameParams: Various parameters with special meanings; see documentation in
890 includes/Linker.php for Linker::makeImageLink2
891 &$handlerParams: Various parameters with special meanings; see documentation in
892 includes/Linker.php for Linker::makeImageLink2
893 &$time: Timestamp of file in 'YYYYMMDDHHIISS' string form, or false for current
894 &$res: Final HTML output, used if you return false
895
896
897 'ImageOpenShowImageInlineBefore': Call potential extension just before showing
898 the image on an image page
899 $imagePage: ImagePage object ($this)
900 $output: $wgOut
901
902 'ImagePageAfterImageLinks': called after the image links section on an image
903 page is built
904 $imagePage: ImagePage object ($this)
905 &$html: HTML for the hook to add
906
907 'ImagePageFileHistoryLine': called when a file history line is contructed
908 $file: the file
909 $line: the HTML of the history line
910 $css: the line CSS class
911
912 'ImagePageFindFile': called when fetching the file associated with an image page
913 $page: ImagePage object
914 &$file: File object
915 &$displayFile: displayed File object
916
917 'ImagePageShowTOC': called when the file toc on an image page is generated
918 $page: ImagePage object
919 &$toc: Array of <li> strings
920
921 'ImgAuthBeforeStream': executed before file is streamed to user, but only when
922 using img_auth.php
923 &$title: the Title object of the file as it would appear for the upload page
924 &$path: the original file and path name when img_auth was invoked by the the web
925 server
926 &$name: the name only component of the file
927 &$result: The location to pass back results of the hook routine (only used if
928 failed)
929 $result[0]=The index of the header message
930 $result[1]=The index of the body text message
931 $result[2 through n]=Parameters passed to body text message. Please note the
932 header message cannot receive/use parameters.
933
934 'ImportHandleLogItemXMLTag': When parsing a XML tag in a log item
935 $reader: XMLReader object
936 $logInfo: Array of information
937 Return false to stop further processing of the tag
938
939 'ImportHandlePageXMLTag': When parsing a XML tag in a page
940 $reader: XMLReader object
941 $pageInfo: Array of information
942 Return false to stop further processing of the tag
943
944 'ImportHandleRevisionXMLTag': When parsing a XML tag in a page revision
945 $reader: XMLReader object
946 $revInfo: Array of information
947 Return false to stop further processing of the tag
948
949 'ImportHandleToplevelXMLTag': When parsing a top level XML tag
950 $reader: XMLReader object
951 Return false to stop further processing of the tag
952
953 'ImportHandleUploadXMLTag': When parsing a XML tag in a file upload
954 $reader: XMLReader object
955 $revisionInfo: Array of information
956 Return false to stop further processing of the tag
957
958 'InitializeArticleMaybeRedirect': MediaWiki check to see if title is a redirect
959 $title: Title object ($wgTitle)
960 $request: WebRequest
961 $ignoreRedirect: boolean to skip redirect check
962 $target: Title/string of redirect target
963 $article: Article object
964
965 'InternalParseBeforeLinks': during Parser's internalParse method before links
966 but after noinclude/includeonly/onlyinclude and other processing.
967 &$parser: Parser object
968 &$text: string containing partially parsed text
969 &$stripState: Parser's internal StripState object
970
971 'InvalidateEmailComplete': Called after a user's email has been invalidated successfully
972 $user: user (object) whose email is being invalidated
973
974 'IsFileCacheable': Override the result of Article::isFileCacheable() (if true)
975 $article: article (object) being checked
976
977 'IsTrustedProxy': Override the result of wfIsTrustedProxy()
978 $ip: IP being check
979 $result: Change this value to override the result of wfIsTrustedProxy()
980
981 'isValidEmailAddr': Override the result of User::isValidEmailAddr(), for ins-
982 tance to return false if the domain name doesn't match your organization
983 $addr: The e-mail address entered by the user
984 &$result: Set this and return false to override the internal checks
985
986 'isValidPassword': Override the result of User::isValidPassword()
987 $password: The password entered by the user
988 &$result: Set this and return false to override the internal checks
989 $user: User the password is being validated for
990
991 'LanguageGetMagic': DEPRECATED, use $magicWords in a file listed in
992 $wgExtensionMessagesFiles instead.
993 Use this to define synonyms of magic words depending of the language
994 $magicExtensions: associative array of magic words synonyms
995 $lang: laguage code (string)
996
997 'LanguageGetSpecialPageAliases': DEPRECATED, use $specialPageAliases in a file
998 listed in $wgExtensionMessagesFiles instead.
999 Use to define aliases of special pages names depending of the language
1000 $specialPageAliases: associative array of magic words synonyms
1001 $lang: laguage code (string)
1002
1003 'LanguageGetTranslatedLanguageNames': Provide translated language names.
1004 &$names: array of language code => language name
1005 $code language of the preferred translations
1006
1007 'LinkBegin': Used when generating internal and interwiki links in
1008 Linker::link(), before processing starts. Return false to skip default proces-
1009 sing and return $ret. See documentation for Linker::link() for details on the
1010 expected meanings of parameters.
1011 $skin: the Skin object
1012 $target: the Title that the link is pointing to
1013 &$text: the contents that the <a> tag should have (raw HTML); null means "de-
1014 fault"
1015 &$customAttribs: the HTML attributes that the <a> tag should have, in associa-
1016 tive array form, with keys and values unescaped. Should be merged with de-
1017 fault values, with a value of false meaning to suppress the attribute.
1018 &$query: the query string to add to the generated URL (the bit after the "?"),
1019 in associative array form, with keys and values unescaped.
1020 &$options: array of options. Can include 'known', 'broken', 'noclasses'.
1021 &$ret: the value to return if your hook returns false.
1022
1023 'LinkEnd': Used when generating internal and interwiki links in Linker::link(),
1024 just before the function returns a value. If you return true, an <a> element
1025 with HTML attributes $attribs and contents $text will be returned. If you re-
1026 turn false, $ret will be returned.
1027 $skin: the Skin object
1028 $target: the Title object that the link is pointing to
1029 $options: the options. Will always include either 'known' or 'broken', and may
1030 include 'noclasses'.
1031 &$text: the final (raw HTML) contents of the <a> tag, after processing.
1032 &$attribs: the final HTML attributes of the <a> tag, after processing, in asso-
1033 ciative array form.
1034 &$ret: the value to return if your hook returns false.
1035
1036 'LinkerMakeExternalImage': At the end of Linker::makeExternalImage() just
1037 before the return
1038 &$url: the image url
1039 &$alt: the image's alt text
1040 &$img: the new image HTML (if returning false)
1041
1042 'LinkerMakeExternalLink': At the end of Linker::makeExternalLink() just
1043 before the return
1044 &$url: the link url
1045 &$text: the link text
1046 &$link: the new link HTML (if returning false)
1047 &$attribs: the attributes to be applied.
1048 $linkType: The external link type
1049
1050 'LinksUpdate': At the beginning of LinksUpdate::doUpdate() just before the
1051 actual update
1052 &$linksUpdate: the LinksUpdate object
1053
1054 'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating has
1055 completed
1056 &$linksUpdate: the LinksUpdate object
1057
1058 'LinksUpdateConstructed': At the end of LinksUpdate() is contruction.
1059 &$linksUpdate: the LinksUpdate object
1060
1061 'ListDefinedTags': When trying to find all defined tags.
1062 &$tags: The list of tags.
1063
1064 'LoadExtensionSchemaUpdates': called during database installation and updates
1065 &updater: A DatabaseUpdater subclass
1066
1067 'LocalFile::getHistory': called before file history query performed
1068 $file: the file
1069 $tables: tables
1070 $fields: select fields
1071 $conds: conditions
1072 $opts: query options
1073 $join_conds: JOIN conditions
1074
1075 'LocalisationCacheRecache': Called when loading the localisation data into cache
1076 $cache: The LocalisationCache object
1077 $code: language code
1078 &$alldata: The localisation data from core and extensions
1079
1080 'LoginAuthenticateAudit': a login attempt for a valid user account either
1081 succeeded or failed. No return data is accepted; this hook is for auditing only.
1082 $user: the User object being authenticated against
1083 $password: the password being submitted and found wanting
1084 $retval: a LoginForm class constant with authenticateUserData() return
1085 value (SUCCESS, WRONG_PASS, etc)
1086
1087 'LogLine': Processes a single log entry on Special:Log
1088 $log_type: string for the type of log entry (e.g. 'move'). Corresponds to
1089 logging.log_type database field.
1090 $log_action: string for the type of log action (e.g. 'delete', 'block',
1091 'create2'). Corresponds to logging.log_action database field.
1092 $title: Title object that corresponds to logging.log_namespace and
1093 logging.log_title database fields.
1094 $paramArray: Array of parameters that corresponds to logging.log_params field.
1095 Note that only $paramArray[0] appears to contain anything.
1096 &$comment: string that corresponds to logging.log_comment database field, and
1097 which is displayed in the UI.
1098 &$revert: string that is displayed in the UI, similar to $comment.
1099 $time: timestamp of the log entry (added in 1.12)
1100
1101 'LogPageValidTypes': action being logged.
1102 DEPRECATED: Use $wgLogTypes
1103 &$type: array of strings
1104
1105 'LogPageLogName': name of the logging page(s).
1106 DEPRECATED: Use $wgLogNames
1107 &$typeText: array of strings
1108
1109 'LogPageLogHeader': strings used by wfMsg as a header.
1110 DEPRECATED: Use $wgLogHeaders
1111 &$headerText: array of strings
1112
1113 'LogPageActionText': strings used by wfMsg as a header.
1114 DEPRECATED: Use $wgLogActions
1115 &$actionText: array of strings
1116
1117 'MagicWordMagicWords': When defining new magic word.
1118 DEPRECATED: use $magicWords in a file listed in
1119 $wgExtensionMessagesFiles instead.
1120 $magicWords: array of strings
1121
1122 'MagicWordwgVariableIDs': When definig new magic words IDs.
1123 $variableIDs: array of strings
1124
1125 'MakeGlobalVariablesScript': called right before Skin::makeVariablesScript
1126 is executed. Ideally, this hook should only be used to add variables that
1127 depend on the current page/request; static configuration should be added
1128 through ResourceLoaderGetConfigVars instead.
1129 &$vars: variable (or multiple variables) to be added into the output
1130 of Skin::makeVariablesScript
1131
1132 'MarkPatrolled': before an edit is marked patrolled
1133 $rcid: ID of the revision to be marked patrolled
1134 $user: the user (object) marking the revision as patrolled
1135 $wcOnlySysopsCanPatrol: config setting indicating whether the user
1136 needs to be a sysop in order to mark an edit patrolled
1137
1138 'MarkPatrolledComplete': after an edit is marked patrolled
1139 $rcid: ID of the revision marked as patrolled
1140 $user: user (object) who marked the edit patrolled
1141 $wcOnlySysopsCanPatrol: config setting indicating whether the user
1142 must be a sysop to patrol the edit
1143
1144 'MathAfterTexvc': after texvc is executed when rendering mathematics
1145 $mathRenderer: instance of MathRenderer
1146 $errmsg: error message, in HTML (string). Nonempty indicates failure
1147 of rendering the formula
1148
1149 'MediaWikiPerformAction': Override MediaWiki::performAction().
1150 Use this to do something completely different, after the basic
1151 globals have been set up, but before ordinary actions take place.
1152 $output: $wgOut
1153 $article: $wgArticle
1154 $title: $wgTitle
1155 $user: $wgUser
1156 $request: $wgRequest
1157 $mediaWiki: The $mediawiki object
1158
1159 'MessagesPreLoad': When loading a message from the database
1160 $title: title of the message (string)
1161 $message: value (string), change it to the message you want to define
1162
1163 'MessageCacheReplace': When a message page is changed.
1164 Useful for updating caches.
1165 $title: name of the page changed.
1166 $text: new contents of the page.
1167
1168 'ModifyExportQuery': Modify the query used by the exporter.
1169 $db: The database object to be queried.
1170 &$tables: Tables in the query.
1171 &$conds: Conditions in the query.
1172 &$opts: Options for the query.
1173 &$join_conds: Join conditions for the query.
1174
1175 'MonoBookTemplateToolboxEnd': Called by Monobook skin after toolbox links have
1176 been rendered (useful for adding more)
1177 Note: this is only run for the Monobook skin. This hook is deprecated and
1178 may be removed in the future. To add items to the toolbox you should use
1179 the SkinTemplateToolboxEnd hook instead, which works for all
1180 "SkinTemplate"-type skins.
1181 $tools: array of tools
1182
1183 'BaseTemplateToolbox': Called by BaseTemplate when building the $toolbox array
1184 and returning it for the skin to output. You can add items to the toolbox while
1185 still letting the skin make final decisions on skin-specific markup conventions
1186 using this hook.
1187 &$sk: The BaseTemplate base skin template
1188 &$toolbox: An array of toolbox items, see BaseTemplate::getToolbox and
1189 BaseTemplate::makeListItem for details on the format of individual
1190 items inside of this array
1191
1192 'NewRevisionFromEditComplete': called when a revision was inserted
1193 due to an edit
1194 $article: the article edited
1195 $rev: the new revision
1196 $baseID: the revision ID this was based off, if any
1197 $user: the editing user
1198
1199 'NormalizeMessageKey': Called before the software gets the text of a message
1200 (stuff in the MediaWiki: namespace), useful for changing WHAT message gets
1201 displayed
1202 &$key: the message being looked up. Change this to something else to change
1203 what message gets displayed (string)
1204 &$useDB: whether or not to look up the message in the database (bool)
1205 &$langCode: the language code to get the message for (string) - or -
1206 whether to use the content language (true) or site language (false) (bool)
1207 &$transform: whether or not to expand variables and templates
1208 in the message (bool)
1209
1210 'OldChangesListRecentChangesLine': Customize entire Recent Changes line.
1211 &$changeslist: The OldChangesList instance.
1212 &$s: HTML of the form "<li>...</li>" containing one RC entry.
1213 &$rc: The RecentChange object.
1214
1215 'OpenSearchUrls': Called when constructing the OpenSearch description XML.
1216 Hooks can alter or append to the array of URLs for search & suggestion formats.
1217 &$urls: array of associative arrays with Url element attributes
1218
1219 'OtherBlockLogLink': Get links to the block log from extensions which blocks
1220 users and/or IP addresses too
1221 $otherBlockLink: An array with links to other block logs
1222 $ip: The requested IP address or username
1223
1224 'OutputPageBeforeHTML': a page has been processed by the parser and
1225 the resulting HTML is about to be displayed.
1226 $parserOutput: the parserOutput (object) that corresponds to the page
1227 $text: the text that will be displayed, in HTML (string)
1228
1229 'OutputPageBodyAttributes': called when OutputPage::headElement is creating the body
1230 tag to allow for extensions to add attributes to the body of the page they might
1231 need. Or to allow building extensions to add body classes that aren't of high
1232 enough demand to be included in core.
1233 $out: The OutputPage which called the hook, can be used to get the real title
1234 $sk: The Skin that called OutputPage::headElement
1235 &$bodyAttrs: An array of attributes for the body tag passed to Html::openElement
1236
1237 'OutputPageCheckLastModified': when checking if the page has been modified
1238 since the last visit
1239 &$modifiedTimes: array of timestamps.
1240 The following keys are set: page, user, epoch
1241
1242 'OutputPageParserOutput': after adding a parserOutput to $wgOut
1243 $out: OutputPage instance (object)
1244 $parserOutput: parserOutput instance being added in $out
1245
1246 'OutputPageMakeCategoryLinks': links are about to be generated for the page's
1247 categories. Implementations should return false if they generate the category
1248 links, so the default link generation is skipped.
1249 $out: OutputPage instance (object)
1250 $categories: associative array, keys are category names, values are category
1251 types ("normal" or "hidden")
1252 $links: array, intended to hold the result. Must be an associative array with
1253 category types as keys and arrays of HTML links as values.
1254
1255 'PageHistoryBeforeList': When a history page list is about to be constructed.
1256 $article: the article that the history is loading for
1257
1258 'PageHistoryLineEnding' : right before the end <li> is added to a history line
1259 $row: the revision row for this line
1260 $s: the string representing this parsed line
1261 $classes: array containing the <li> element classes
1262
1263 'PageHistoryPager::getQueryInfo': when a history pager query parameter set
1264 is constructed
1265 $pager: the pager
1266 $queryInfo: the query parameters
1267
1268 'PageRenderingHash': alter the parser cache option hash key
1269 A parser extension which depends on user options should install
1270 this hook and append its values to the key.
1271 $hash: reference to a hash key string which can be modified
1272
1273 'ParserAfterStrip': Same as ParserBeforeStrip
1274
1275 'ParserAfterTidy': Called after Parser::tidy() in Parser::parse()
1276 $parser: Parser object being used
1277 $text: text that'll be returned
1278
1279 'ParserBeforeInternalParse': called at the beginning of Parser::internalParse()
1280 $parser: Parser object
1281 $text: text to parse
1282 $stripState: StripState instance being used
1283
1284 'ParserBeforeStrip': Called at start of parsing time
1285 (no more strip, deprecated ?)
1286 $parser: parser object
1287 $text: text being parsed
1288 $stripState: stripState used (object)
1289
1290 'ParserBeforeTidy': called before tidy and custom tags replacements
1291 $parser: Parser object being used
1292 $text: actual text
1293
1294 'ParserClearState': called at the end of Parser::clearState()
1295 $parser: Parser object being cleared
1296
1297 'ParserFirstCallInit': called when the parser initialises for the first time
1298 &$parser: Parser object being cleared
1299
1300 'ParserGetVariableValueSwitch': called when the parser need the value of a
1301 custom magic word
1302 $parser: Parser object
1303 $varCache: array to store the value in case of multiples calls of the
1304 same magic word
1305 $index: index (string) of the magic
1306 $ret: value of the magic word (the hook should set it)
1307 $frame: PPFrame object to use for expanding any template variables
1308
1309 'ParserGetVariableValueTs': use this to change the value of the time for the
1310 {{LOCAL...}} magic word
1311 $parser: Parser object
1312 $time: actual time (timestamp)
1313
1314 'ParserGetVariableValueVarCache': use this to change the value of the
1315 variable cache or return false to not use it
1316 $parser: Parser object
1317 $varCache: varaiable cache (array)
1318
1319 'ParserLimitReport': called at the end of Parser:parse() when the parser will
1320 include comments about size of the text parsed
1321 $parser: Parser object
1322 $limitReport: text that will be included (without comment tags)
1323
1324 'ParserMakeImageParams': Called before the parser make an image link, use this
1325 to modify the parameters of the image.
1326 $title: title object representing the file
1327 $file: file object that will be used to create the image
1328 &$params: 2-D array of parameters
1329
1330 'ParserTestParser': called when creating a new instance of Parser in
1331 maintenance/parserTests.inc
1332 $parser: Parser object created
1333
1334 'ParserTestTables': alter the list of tables to duplicate when parser tests
1335 are run. Use when page save hooks require the presence of custom tables
1336 to ensure that tests continue to run properly.
1337 &$tables: array of table names
1338
1339 'PersonalUrls': Alter the user-specific navigation links (e.g. "my page,
1340 my talk page, my contributions" etc).
1341
1342 &$personal_urls: Array of link specifiers (see SkinTemplate.php)
1343 &$title: Title object representing the current page
1344
1345 'PingLimiter': Allows extensions to override the results of User::pingLimiter()
1346 &$user : User performing the action
1347 $action : Action being performed
1348 &$result : Whether or not the action should be prevented
1349 Change $result and return false to give a definitive answer, otherwise
1350 the built-in rate limiting checks are used, if enabled.
1351
1352 'PrefixSearchBackend': Override the title prefix search used for OpenSearch and
1353 AJAX search suggestions. Put results into &$results outparam and return false.
1354 $ns : array of int namespace keys to search in
1355 $search : search term (not guaranteed to be conveniently normalized)
1356 $limit : maximum number of results to return
1357 &$results : out param: array of page names (strings)
1358
1359 'PrefsEmailAudit': called when user changes his email address
1360 $user: User (object) changing his email address
1361 $oldaddr: old email address (string)
1362 $newaddr: new email address (string)
1363
1364 'PrefsPasswordAudit': called when user changes his password
1365 $user: User (object) changing his passoword
1366 $newPass: new password
1367 $error: error (string) 'badretype', 'wrongpassword', 'error' or 'success'
1368
1369 'ProtectionForm::buildForm': called after all protection type fieldsets are made in the form
1370 $article: the title being (un)protected
1371 $output: a string of the form HTML so far
1372
1373 'ProtectionForm::save': called when a protection form is submitted
1374 $article: the title being (un)protected
1375 $errorMsg: an html message string of an error
1376
1377 'ProtectionForm::showLogExtract': called after the protection log extract is shown
1378 $article: the page the form is shown for
1379 $out: OutputPage object
1380
1381 'ResourceLoaderRegisterModules': Right before modules information is required, such as when responding to a resource
1382 loader request or generating HTML output.
1383 &$resourceLoader: ResourceLoader object
1384
1385 'RawPageViewBeforeOutput': Right before the text is blown out in action=raw
1386 &$obj: RawPage object
1387 &$text: The text that's going to be the output
1388
1389 'RecentChange_save': called at the end of RecentChange::save()
1390 $recentChange: RecentChange object
1391
1392 'ResourceLoaderGetConfigVars': called at the end of
1393 ResourceLoaderStartUpModule::getConfig(). Use this to export static
1394 configuration variables to JavaScript. Things that depend on the current
1395 page/request state must be added through MakeGlobalVariablesScript instead.
1396 &$vars: array( variable name => value )
1397
1398 'RevisionInsertComplete': called after a revision is inserted into the DB
1399 &$revision: the Revision
1400 $data: the data stored in old_text. The meaning depends on $flags: if external
1401 is set, it's the URL of the revision text in external storage; otherwise,
1402 it's the revision text itself. In either case, if gzip is set, the revision
1403 text is gzipped.
1404 $flags: a comma-delimited list of strings representing the options used. May
1405 include: utf8 (this will always be set for new revisions); gzip; external.
1406
1407 'SearchUpdate': Prior to search update completion
1408 $id : Page id
1409 $namespace : Page namespace
1410 $title : Page title
1411 $text : Current text being indexed
1412
1413 'SearchGetNearMatchBefore': Perform exact-title-matches in "go" searches before the normal operations
1414 $allSearchTerms : Array of the search terms in all content languages
1415 &$titleResult : Outparam; the value to return. A Title object or null.
1416
1417 'SearchGetNearMatch': An extra chance for exact-title-matches in "go" searches if nothing was found
1418 $term : Search term string
1419 &$title : Outparam; set to $title object and return false for a match
1420
1421 'SearchGetNearMatchComplete': A chance to modify exact-title-matches in "go" searches
1422 $term : Search term string
1423 &$title : Current Title object that is being returned (null if none found).
1424
1425 'SearchEngineReplacePrefixesComplete': Run after SearchEngine::replacePrefixes().
1426 $searchEngine : The SearchEngine object. Users of this hooks will be interested
1427 in the $searchEngine->namespaces array.
1428 $query : Original query.
1429 &$parsed : Resultant query with the prefixes stripped.
1430
1431 'SearchableNamespaces': An option to modify which namespaces are searchable.
1432 &$arr : Array of namespaces ($nsId => $name) which will be used.
1433
1434 'SetupAfterCache': Called in Setup.php, after cache objects are set
1435
1436 'SetupUserMessageArticle': Called in User::leaveUserMessage() before
1437 anything has been posted to the article.
1438 $user: The user who we left the message for.
1439 &$article: The article that will be posted to.
1440 $subject: The subject of the message
1441 $text: The text of the message.
1442 $signature: The signature we used.
1443 $summary: The edit summary.
1444 $editor: The editor that performed the edit.
1445
1446 'ShowMissingArticle': Called when generating the output for a non-existent page
1447 $article: The article object corresponding to the page
1448
1449 'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
1450 $text: Text being shown
1451 $title: Title of the custom script/stylesheet page
1452 $output: Current OutputPage object
1453
1454 'ShowSearchHitTitle': Customise display of search hit title/link.
1455 &$title: Title to link to
1456 &$text: Text to use for the link
1457 $result: The search result
1458 $terms: The search terms entered
1459 $page: The SpecialSearch object.
1460
1461 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
1462 &$siteNotice: HTML returned as the sitenotice
1463 $skin: Skin object
1464 Return true to allow the normal method of notice selection/rendering to work,
1465 or change the value of $siteNotice and return false to alter it.
1466
1467 'SiteNoticeAfter': After the sitenotice/anonnotice is composed
1468 &$siteNotice: HTML sitenotice
1469 $skin: Skin object
1470 Alter the contents of $siteNotice to add to/alter the sitenotice/anonnotice.
1471
1472 'SkinAfterBottomScripts': At the end of Skin::bottomScripts()
1473 $skin: Skin object
1474 &$text: bottomScripts Text
1475 Append to $text to add additional text/scripts after the stock bottom scripts.
1476
1477 'SkinAfterContent': Allows extensions to add text after the page content and
1478 article metadata.
1479 &$data: (string) Text to be printed out directly (without parsing)
1480 $skin: Skin object
1481 This hook should work in all skins. Just set the &$data variable to the text
1482 you're going to add.
1483
1484 'SkinBuildSidebar': At the end of Skin::buildSidebar()
1485 $skin: Skin object
1486 &$bar: Sidebar contents
1487 Modify $bar to add or modify sidebar portlets.
1488
1489 'SkinCopyrightFooter': Allow for site and per-namespace customization of copyright notice.
1490 $title: displayed page title
1491 $type: 'normal' or 'history' for old/diff views
1492 &$msg: overridable message; usually 'copyright' or 'history_copyright'. This message must be in HTML format, not wikitext!
1493 &$link: overridable HTML link to be passed into the message as $1
1494 &$forContent: overridable flag if copyright footer is shown in content language.
1495
1496 'SkinGetPoweredBy'
1497 &$text: additional 'powered by' icons in HTML.
1498 Note: Modern skin does not use the MediaWiki icon but plain text instead
1499 $skin: Skin object
1500
1501 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle()
1502 &$subpages: Subpage links HTML
1503 $skin: Skin object
1504 $out: OutputPage object
1505 If false is returned $subpages will be used instead of the HTML
1506 subPageSubtitle() generates.
1507 If true is returned, $subpages will be ignored and the rest of
1508 subPageSubtitle() will run.
1509
1510 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink': after creating the
1511 "permanent link" tab
1512 $sktemplate: SkinTemplate object
1513 $nav_urls: array of tabs
1514
1515 Alter the structured navigation links in SkinTemplates, there are three of these hooks called in different spots.
1516 'SkinTemplateNavigation': Called on content pages after the tabs have been added but before before variants have been added
1517 'SkinTemplateNavigation::SpecialPage': Called on special pages after the special tab is added but before variants have been added
1518 'SkinTemplateNavigation::Universal': Called on both content and special pages after variants have been added
1519 &$sktemplate: SkinTemplate object
1520 &$links: Structured navigation links
1521 This is used to alter the navigation for skins which use buildNavigationUrls such as Vector.
1522
1523 'SkinTemplateOutputPageBeforeExec': Before SkinTemplate::outputPage()
1524 starts page output
1525 &$sktemplate: SkinTemplate object
1526 &$tpl: Template engine object
1527
1528 'SkinTemplatePreventOtherActiveTabs': use this to prevent showing active tabs
1529 $sktemplate: SkinTemplate object
1530 $res: set to true to prevent active tabs
1531
1532 'SkinTemplateSetupPageCss': use this to provide per-page CSS
1533 $out: Css to return
1534
1535 'SkinTemplateTabAction': Override SkinTemplate::tabAction().
1536 You can either create your own array, or alter the parameters for
1537 the normal one.
1538 &$sktemplate: The SkinTemplate instance.
1539 $title: Title instance for the page.
1540 $message: Visible label of tab.
1541 $selected: Whether this is a selected tab.
1542 $checkEdit: Whether or not the action=edit query should be added if appropriate.
1543 &$classes: Array of CSS classes to apply.
1544 &$query: Query string to add to link.
1545 &$text: Link text.
1546 &$result: Complete assoc. array if you want to return true.
1547
1548 'SkinTemplateToolboxEnd': Called by SkinTemplate skins after toolbox links have
1549 been rendered (useful for adding more)
1550 $sk: The QuickTemplate based skin template running the hook.
1551
1552 'SoftwareInfo': Called by Special:Version for returning information about
1553 the software
1554 $software: The array of software in format 'name' => 'version'.
1555 See SpecialVersion::softwareInformation()
1556
1557 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions
1558 $id: User identifier
1559
1560 'SpecialListusersDefaultQuery': called right before the end of
1561 UsersPager::getDefaultQuery()
1562 $pager: The UsersPager instance
1563 $query: The query array to be returned
1564
1565 'SpecialListusersFormatRow': called right before the end of
1566 UsersPager::formatRow()
1567 $item: HTML to be returned. Will be wrapped in <li></li> after the hook finishes
1568 $row: Database row object
1569
1570 'SpecialListusersHeader': called before closing the <fieldset> in
1571 UsersPager::getPageHeader()
1572 $pager: The UsersPager instance
1573 $out: The header HTML
1574
1575 'SpecialListusersHeaderForm': called before adding the submit button in
1576 UsersPager::getPageHeader()
1577 $pager: The UsersPager instance
1578 $out: The header HTML
1579
1580 'SpecialListusersQueryInfo': called right before the end of
1581 UsersPager::getQueryInfo()
1582 $pager: The UsersPager instance
1583 $query: The query array to be returned
1584
1585 'SpecialMovepageAfterMove': called after moving a page
1586 $movePage: MovePageForm object
1587 $oldTitle: old title (object)
1588 $newTitle: new title (object)
1589
1590 'SpecialNewpagesConditions': called when building sql query for Special:NewPages
1591 &$special: NewPagesPager object (subclass of ReverseChronologicalPager)
1592 $opts: FormOptions object containing special page options
1593 &$conds: array of WHERE conditionals for query
1594
1595 'SpecialPage_initList': called when setting up SpecialPage::$mList, use this
1596 hook to remove a core special page
1597 $list: list (array) of core special pages
1598
1599 'SpecialRandomGetRandomTitle': called during the execution of Special:Random,
1600 use this to change some selection criteria or substitute a different title
1601 &$randstr: The random number from wfRandom()
1602 &$isRedir: Boolean, whether to select a redirect or non-redirect
1603 &$namespaces: An array of namespace indexes to get the title from
1604 &$extra: An array of extra SQL statements
1605 &$title: If the hook returns false, a Title object to use instead of the
1606 result from the normal query
1607
1608 'SpecialRecentChangesPanel': called when building form options in
1609 SpecialRecentChanges
1610 &$extraOpts: array of added items, to which can be added
1611 $opts: FormOptions for this request
1612
1613 'SpecialRecentChangesQuery': called when building sql query for
1614 SpecialRecentChanges and SpecialRecentChangesLinked
1615 &$conds: array of WHERE conditionals for query
1616 &$tables: array of tables to be queried
1617 &$join_conds: join conditions for the tables
1618 $opts: FormOptions for this request
1619 &$query_options: array of options for the database request
1620 &$select: String '*' or array of columns to select
1621
1622 'SpecialSearchGo': called when user clicked the "Go"
1623 &$title: title object generated from the text entered by the user
1624 &$term: the search term entered by the user
1625
1626 'SpecialSearchNogomatch': called when user clicked the "Go" button but the
1627 target doesn't exist
1628 &$title: title object generated from the text entered by the user
1629
1630 'SpecialSearchProfiles': allows modification of search profiles
1631 &$profiles: profiles, which can be modified.
1632
1633 'SpecialSearchResults': called before search result display when there
1634 are matches
1635 $term: string of search term
1636 &$titleMatches: empty or SearchResultSet object
1637 &$textMatches: empty or SearchResultSet object
1638
1639 'SpecialSearchNoResults': called before search result display when there are
1640 no matches
1641 $term: string of search term
1642
1643 'SpecialStatsAddExtra': add extra statistic at the end of Special:Statistics
1644 &$extraStats: Array to save the new stats
1645 ( $extraStats['<name of statistic>'] => <value>; )
1646
1647 'SpecialUploadComplete': Called after successfully uploading a file from
1648 Special:Upload
1649 $form: The SpecialUpload object
1650
1651 'SpecialVersionExtensionTypes': called when generating the extensions credits,
1652 use this to change the tables headers
1653 $extTypes: associative array of extensions types
1654
1655 'SpecialWatchlistQuery': called when building sql query for SpecialWatchlist
1656 &$conds: array of WHERE conditionals for query
1657 &$tables: array of tables to be queried
1658 &$join_conds: join conditions for the tables
1659 &$fields: array of query fields
1660
1661 'TitleArrayFromResult': called when creating an TitleArray object from a
1662 database result
1663 &$titleArray: set this to an object to override the default object returned
1664 $res: database result used to create the object
1665
1666 'TitleGetRestrictionTypes': Allows extensions to modify the types of protection
1667 that can be applied.
1668 $title: The title in question.
1669 &$types: The types of protection available.
1670
1671 'TitleMoveComplete': after moving an article (title)
1672 $old: old title
1673 $nt: new title
1674 $user: user who did the move
1675 $pageid: database ID of the page that's been moved
1676 $redirid: database ID of the created redirect
1677
1678 'UndeleteShowRevision': called when showing a revision in Special:Undelete
1679 $title: title object related to the revision
1680 $rev: revision (object) that will be viewed
1681
1682 'UnknownAction': An unknown "action" has occured (useful for defining
1683 your own actions)
1684 $action: action name
1685 $article: article "acted on"
1686
1687 'UnitTestsList': Called when building a list of files with PHPUnit tests
1688 &$files: list of files
1689
1690 'UnwatchArticle': before a watch is removed from an article
1691 $user: user watching
1692 $article: article object to be removed
1693
1694 'UnwatchArticle': after a watch is removed from an article
1695 $user: user that was watching
1696 $article: article object removed
1697
1698 'UnwatchArticleComplete': after a watch is removed from an article
1699 $user: user that watched
1700 $article: article object that was watched
1701
1702 'UploadForm:initial': before the upload form is generated
1703 $form: UploadForm object
1704 You might set the member-variables $uploadFormTextTop and
1705 $uploadFormTextAfterSummary to inject text (HTML) either before
1706 or after the editform.
1707
1708 'UploadForm:BeforeProcessing': at the beginning of processUpload()
1709 $form: UploadForm object
1710 Lets you poke at member variables like $mUploadDescription before the
1711 file is saved.
1712 Do not use this hook to break upload processing. This will return the user to
1713 a blank form with no error message; use UploadVerification and
1714 UploadVerifyFile instead
1715
1716 'UploadCreateFromRequest': when UploadBase::createFromRequest has been called
1717 $type: (string) the requested upload type
1718 &$className: the class name of the Upload instance to be created
1719
1720 'UploadComplete': when Upload completes an upload
1721 &$upload: an UploadBase child instance
1722
1723 'UploadFormInitDescriptor': after the descriptor for the upload form as been
1724 assembled
1725 $descriptor: (array) the HTMLForm descriptor
1726
1727 'UploadFormSourceDescriptors': after the standard source inputs have been
1728 added to the descriptor
1729 $descriptor: (array) the HTMLForm descriptor
1730
1731 'UploadVerification': additional chances to reject an uploaded file. Consider
1732 using UploadVerifyFile instead.
1733 string $saveName: destination file name
1734 string $tempName: filesystem path to the temporary file for checks
1735 string &$error: output: message key for message to show if upload canceled
1736 by returning false. May also be an array, where the first element
1737 is the message key and the remaining elements are used as parameters to
1738 the message.
1739
1740 'UploadVerifyFile': extra file verification, based on mime type, etc. Preferred
1741 in most cases over UploadVerification.
1742 object $upload: an instance of UploadBase, with all info about the upload
1743 string $mime: the uploaded file's mime type, as detected by MediaWiki. Handlers
1744 will typically only apply for specific mime types.
1745 object &$error: output: true if the file is valid. Otherwise, an indexed array
1746 representing the problem with the file, where the first element
1747 is the message key and the remaining elements are used as parameters to
1748 the message.
1749
1750 'UploadComplete': Upon completion of a file upload
1751 $uploadBase: UploadBase (or subclass) object. File can be accessed by
1752 $uploadBase->getLocalFile().
1753
1754 'User::mailPasswordInternal': before creation and mailing of a user's new
1755 temporary password
1756 $user: the user who sent the message out
1757 $ip: IP of the user who sent the message out
1758 $u: the account whose new password will be set
1759
1760 'UserArrayFromResult': called when creating an UserArray object from a
1761 database result
1762 &$userArray: set this to an object to override the default object returned
1763 $res: database result used to create the object
1764
1765 'userCan': To interrupt/advise the "user can do X to Y article" check.
1766 If you want to display an error message, try getUserPermissionsErrors.
1767 $title: Title object being checked against
1768 $user : Current user object
1769 $action: Action being checked
1770 $result: Pointer to result returned if hook returns false. If null is returned,
1771 userCan checks are continued by internal code.
1772
1773 'UserCanSendEmail': To override User::canSendEmail() permission check
1774 $user: User (object) whose permission is being checked
1775 &$canSend: bool set on input, can override on output
1776
1777 'UserClearNewTalkNotification': called when clearing the
1778 "You have new messages!" message, return false to not delete it
1779 $user: User (object) that'll clear the message
1780
1781 'UserComparePasswords': called when checking passwords, return false to
1782 override the default password checks
1783 &$hash: String of the password hash (from the database)
1784 &$password: String of the plaintext password the user entered
1785 &$userId: Integer of the user's ID or Boolean false if the user ID was not
1786 supplied
1787 &$result: If the hook returns false, this Boolean value will be checked to
1788 determine if the password was valid
1789
1790 'UserCreateForm': change to manipulate the login form
1791 $template: SimpleTemplate instance for the form
1792
1793 'UserCryptPassword': called when hashing a password, return false to implement
1794 your own hashing method
1795 &$password: String of the plaintext password to encrypt
1796 &$salt: String of the password salt or Boolean false if no salt is provided
1797 &$wgPasswordSalt: Boolean of whether the salt is used in the default
1798 hashing method
1799 &$hash: If the hook returns false, this String will be used as the hash
1800
1801 'UserEffectiveGroups': Called in User::getEffectiveGroups()
1802 $user: User to get groups for
1803 &$groups: Current effective groups
1804
1805 'UserGetAllRights': after calculating a list of all available rights
1806 &$rights: Array of rights, which may be added to.
1807
1808 'UserGetEmail': called when getting an user email address
1809 $user: User object
1810 &$email: email, change this to override local email
1811
1812 'UserGetEmailAuthenticationTimestamp': called when getting the timestamp of
1813 email authentification
1814 $user: User object
1815 &$timestamp: timestamp, change this to override local email authentification
1816 timestamp
1817
1818 'UserGetImplicitGroups': Called in User::getImplicitGroups()
1819 &$groups: List of implicit (automatically-assigned) groups
1820
1821 'UserGetReservedNames': allows to modify $wgReservedUsernames at run time
1822 &$reservedUsernames: $wgReservedUsernames
1823
1824 'UserGetRights': Called in User::getRights()
1825 $user: User to get rights for
1826 &$rights: Current rights
1827
1828 'UserIsBlockedFrom': Check if a user is blocked from a specific page (for specific block
1829 exemptions).
1830 $user: User in question
1831 $title: Title of the page in question
1832 &$blocked: Out-param, whether or not the user is blocked from that page.
1833 &$allowUsertalk: If the user is blocked, whether or not the block allows users to edit their
1834 own user talk pages.
1835
1836 'UserIsBlockedGlobally': Check if user is blocked on all wikis.
1837 &$user: User object
1838 $ip: User's IP address
1839 &$blocked: Whether the user is blocked, to be modified by the hook
1840
1841 'UserLoadAfterLoadFromSession': called to authenticate users on
1842 external/environmental means; occurs after session is loaded
1843 $user: user object being loaded
1844
1845 'UserLoadDefaults': called when loading a default user
1846 $user: user object
1847 $name: user name
1848
1849 'UserLoadFromDatabase': called when loading a user from the database
1850 $user: user object
1851 &$s: database query object
1852
1853 'UserLoadFromSession': called to authenticate users on external/environmental
1854 means; occurs before session is loaded
1855 $user: user object being loaded
1856 &$result: set this to a boolean value to abort the normal authentification
1857 process
1858
1859 'UserLoadOptions': when user options/preferences are being loaded from
1860 the database.
1861 $user: User object
1862 &$options: Options, can be modified.
1863
1864 'UserLoginComplete': after a user has logged in
1865 $user: the user object that was created on login
1866 $inject_html: Any HTML to inject after the "logged in" message.
1867
1868 'UserLoginForm': change to manipulate the login form
1869 $template: SimpleTemplate instance for the form
1870
1871 'UserLoginMailPassword': Block users from emailing passwords
1872 $name: the username to email the password of.
1873 &$error: out-param - the error message to return.
1874
1875 'UserLogout': before a user logs out
1876 $user: the user object that is about to be logged out
1877
1878 'UserLogoutComplete': after a user has logged out
1879 $user: the user object _after_ logout (won't have name, ID, etc.)
1880 $inject_html: Any HTML to inject after the "logged out" message.
1881 $oldName: name of the user before logout (string)
1882
1883 'UserRights': After a user's group memberships are changed
1884 $user : User object that was changed
1885 $add : Array of strings corresponding to groups added
1886 $remove: Array of strings corresponding to groups removed
1887
1888 'UserRetrieveNewTalks': called when retrieving "You have new messages!"
1889 message(s)
1890 $user: user retrieving new talks messages
1891 $talks: array of new talks page(s)
1892
1893 'UserSaveSettings': called when saving user settings
1894 $user: User object
1895
1896 'UserSaveOptions': Called just before saving user preferences/options.
1897 $user: User object
1898 &$options: Options, modifiable
1899
1900 'UserSetCookies': called when setting user cookies
1901 $user: User object
1902 &$session: session array, will be added to $_SESSION
1903 &$cookies: cookies array mapping cookie name to its value
1904
1905 'UserSetEmail': called when changing user email address
1906 $user: User object
1907 &$email: new email, change this to override new email address
1908
1909 'UserSetEmailAuthenticationTimestamp': called when setting the timestamp
1910 of email authentification
1911 $user: User object
1912 &$timestamp: new timestamp, change this to override local email
1913 authentification timestamp
1914
1915 'WantedPages::getQueryInfo': called in WantedPagesPage::getQueryInfo(), can be
1916 used to alter the SQL query which gets the list of wanted pages
1917 &$wantedPages: WantedPagesPage object
1918 &$query: query array, see QueryPage::getQueryInfo() for format documentation
1919
1920 'WatchArticle': before a watch is added to an article
1921 $user: user that will watch
1922 $article: article object to be watched
1923
1924 'WatchArticleComplete': after a watch is added to an article
1925 $user: user that watched
1926 $article: article object watched
1927
1928 'WatchlistEditorBuildRemoveLine': when building remove lines in
1929 Special:Watchlist/edit
1930 &$tools: array of extra links
1931 $title: Title object
1932 $redirect: whether the page is a redirect
1933 $skin: Skin object
1934
1935 'WikiExporter::dumpStableQuery': Get the SELECT query for "stable" revisions
1936 dumps
1937 One, and only one hook should set this, and return false.
1938 &$tables: Database tables to use in the SELECT query
1939 &$opts: Options to use for the query
1940 &$join: Join conditions
1941
1942 'wgQueryPages': called when initialising $wgQueryPages, use this to add new
1943 query pages to be updated with maintenance/updateSpecialPages.php
1944 $query: $wgQueryPages itself
1945
1946 'XmlDumpWriterOpenPage': Called at the end of XmlDumpWriter::openPage, to allow extra
1947 metadata to be added.
1948 $obj: The XmlDumpWriter object.
1949 &$out: The output string.
1950 $row: The database row for the page.
1951 $title: The title of the page.
1952
1953 'XmlDumpWriterWriteRevision': Called at the end of a revision in an XML dump, to add extra
1954 metadata.
1955 $obj: The XmlDumpWriter object.
1956 &$out: The text being output.
1957 $row: The database row for the revision.
1958 $text: The revision text.
1959
1960 More hooks might be available but undocumented, you can execute
1961 ./maintenance/findhooks.php to find hidden one.