Merge "Http::getProxy() method to get proxy configuration"
[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', 'PageContentSave',
14 'PageContentSaveComplete', '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 ( Hooks::run( 'ArticleShow', array( &$article ) ) ) {
79
80 # code to actually show the article goes here
81
82 Hooks::run( '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['PageContentSaveComplete'][] = array( 'ircNotify', 'TimStarling' );
174 $wgHooks['PageContentSaveComplete'][] = 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 * No return value (or null): the hook has operated successfully. Previously,
182 true was required. This is the default since MediaWiki 1.23.
183 * "some string": an error occurred; processing should stop and the error
184 should be shown to the user
185 * false: the hook has successfully done the work necessary and the calling
186 function should skip
187
188 The last result would be for cases where the hook function replaces the main
189 functionality. For example, if you wanted to authenticate users to a custom
190 system (LDAP, another PHP program, whatever), you could do:
191
192 $wgHooks['UserLogin'][] = array( 'ldapLogin', $ldapServer );
193
194 function ldapLogin( $username, $password ) {
195 # log user into LDAP
196 return false;
197 }
198
199 Returning false makes less sense for events where the action is complete, and
200 will normally be ignored.
201
202 Note that none of the examples made use of create_function() as a way to
203 attach a function to a hook. This is known to cause problems (notably with
204 Special:Version), and should be avoided when at all possible.
205
206 ==Using hooks==
207
208 A calling function or method uses the Hooks::run() function to run the hooks
209 related to a particular event, like so:
210
211 class Article {
212 # ...
213 function protect() {
214 global $wgUser;
215 if ( Hooks::run( 'ArticleProtect', array( &$this, &$wgUser ) ) ) {
216 # protect the article
217 Hooks::run( 'ArticleProtectComplete', array( &$this, &$wgUser ) );
218 }
219 }
220 }
221
222 Hooks::run() returns true if the calling function should continue processing
223 (the hooks ran OK, or there are no hooks to run), or false if it shouldn't (an
224 error occurred, or one of the hooks handled the action already). Checking the
225 return value matters more for "before" hooks than for "complete" hooks.
226
227 Hooks::run() was added in MediaWiki 1.18, before that the global function
228 wfRunHooks must be used, which was deprecated in MediaWiki 1.25.
229
230 Note that hook parameters are passed in an array; this is a necessary
231 inconvenience to make it possible to pass reference values (that can be changed)
232 into the hook code. Also note that earlier versions of wfRunHooks took a
233 variable number of arguments; the array() calling protocol came about after
234 MediaWiki 1.4rc1.
235
236 ==Events and parameters==
237
238 This is a list of known events and parameters; please add to it if you're going
239 to add events to the MediaWiki code.
240
241 'AbortAutoAccount': Return false to cancel automated local account creation,
242 where normally authentication against an external auth plugin would be creating
243 a local account.
244 $user: the User object about to be created (read-only, incomplete)
245 &$abortMsg: out parameter: name of error message to be displayed to user
246
247 'AbortAutoblock': Return false to cancel an autoblock.
248 $autoblockip: The IP going to be autoblocked.
249 &$block: The block from which the autoblock is coming.
250
251 'AbortChangePassword': Return false to cancel password change.
252 $user: the User object to which the password change is occuring
253 $mOldpass: the old password provided by the user
254 $newpass: the new password provided by the user
255 &$abortMsg: the message identifier for abort reason
256
257 'AbortDiffCache': Can be used to cancel the caching of a diff.
258 &$diffEngine: DifferenceEngine object
259
260 'AbortEmailNotification': Can be used to cancel email notifications for an edit.
261 $editor: The User who made the change.
262 $title: The Title of the page that was edited.
263 $rc: The current RecentChange object.
264
265 'AbortLogin': Return false to cancel account login.
266 $user: the User object being authenticated against
267 $password: the password being submitted, not yet checked for validity
268 &$retval: a LoginForm class constant to return from authenticateUserData();
269 default is LoginForm::ABORTED. Note that the client may be using a machine
270 API rather than the HTML user interface.
271 &$msg: the message identifier for abort reason (new in 1.18, not available
272 before 1.18)
273
274 'AbortNewAccount': Return false to cancel explicit account creation.
275 $user: the User object about to be created (read-only, incomplete)
276 &$msg: out parameter: HTML to display on abort
277 &$status: out parameter: Status object to return, replaces the older $msg param
278 (added in 1.23)
279 Create the object with Status::newFatal() to ensure proper API error
280 messages are returned when creating account through API clients.
281
282 'AbortTalkPageEmailNotification': Return false to cancel talk page email
283 notification
284 $targetUser: the user whom to send talk page email notification
285 $title: the page title
286
287 'ActionBeforeFormDisplay': Before executing the HTMLForm object.
288 $name: name of the action
289 &$form: HTMLForm object
290 $article: Article object
291
292 'ActionModifyFormFields': Before creating an HTMLForm object for a page action;
293 Allows to change the fields on the form that will be generated.
294 $name: name of the action
295 &$fields: HTMLForm descriptor array
296 $article: Article object
297
298 'AddNewAccount': After a user account is created.
299 $user: the User object that was created. (Parameter added in 1.7)
300 $byEmail: true when account was created "by email" (added in 1.12)
301
302 'AddNewAccountApiForm': Allow modifying internal login form when creating an
303 account via API.
304 $apiModule: the ApiCreateAccount module calling
305 $loginForm: the LoginForm used
306
307 'AddNewAccountApiResult': Modify API output when creating a new account via API.
308 $apiModule: the ApiCreateAccount module calling
309 $loginForm: the LoginForm used
310 &$result: associative array for API result data
311
312 'AfterBuildFeedLinks': Executed in OutputPage.php after all feed links (atom, rss,...)
313 are created. Can be used to omit specific feeds from being outputted. You must not use
314 this hook to add feeds, use OutputPage::addFeedLink() instead.
315 &$feedLinks: Array of created feed links
316
317 'AfterFinalPageOutput': Nearly at the end of OutputPage::output() but
318 before OutputPage::sendCacheControl() and final ob_end_flush() which
319 will send the buffered output to the client. This allows for last-minute
320 modification of the output within the buffer by using ob_get_clean().
321 $output: The OutputPage object where output() was called
322
323 'AfterImportPage': When a page import is completed.
324 $title: Title under which the revisions were imported
325 $foreignTitle: ForeignTitle object based on data provided by the XML file
326 $revCount: Number of revisions in the XML file
327 $sRevCount: Number of successfully imported revisions
328 $pageInfo: associative array of page information
329
330 'AfterParserFetchFileAndTitle': After an image gallery is formed by Parser,
331 just before adding its HTML to parser output.
332 $parser: Parser object that called the hook
333 $ig: Gallery, an object of one of the gallery classes (inheriting from
334 ImageGalleryBase)
335 &$html: HTML generated by the gallery
336
337 'AlternateEdit': Before checking if a user can edit a page and before showing
338 the edit form ( EditPage::edit() ). This is triggered on &action=edit.
339 $editPage: the EditPage object
340
341 'AlternateEditPreview': Before generating the preview of the page when editing
342 ( EditPage::getPreviewText() ).
343 Return false and set $previewHTML and $parserOutput to output custom page
344 preview HTML.
345 $editPage: the EditPage object
346 &$content: the Content object for the text field from the edit page
347 &$previewHTML: Text to be placed into the page for the preview
348 &$parserOutput: the ParserOutput object for the preview
349
350 'AlternateUserMailer': Called before mail is sent so that mail could be logged
351 (or something else) instead of using PEAR or PHP's mail(). Return false to skip
352 the regular method of sending mail. Return a string to return a php-mail-error
353 message containing the error. Returning true will continue with sending email
354 in the regular way.
355 $headers: Associative array of headers for the email
356 $to: MailAddress object or array
357 $from: From address
358 $subject: Subject of the email
359 $body: Body of the message
360
361 'APIAfterExecute': After calling the execute() method of an API module. Use
362 this to extend core API modules.
363 &$module: Module object
364
365 'ApiBeforeMain': Before calling ApiMain's execute() method in api.php.
366 &$main: ApiMain object
367
368 'ApiCheckCanExecute': Called during ApiMain::checkCanExecute. Use to further
369 authenticate and authorize API clients before executing the module. Return
370 false and set a message to cancel the request.
371 $module: Module object
372 $user: Current user
373 &$message: API usage message to die with, as a message key or array
374 as accepted by ApiBase::dieUsageMsg.
375
376 'APIEditBeforeSave': Before saving a page with api.php?action=edit, after
377 processing request parameters. Return false to let the request fail, returning
378 an error message or an <edit result="Failure"> tag if $resultArr was filled.
379 Unlike for example 'EditFilterMergedContent' this also being run on undo.
380 $editPage: the EditPage object
381 $text: the new text of the article (has yet to be saved)
382 &$resultArr: data in this array will be added to the API result
383
384 'ApiFeedContributions::feedItem': Called to convert the result of ContribsPager
385 into a FeedItem instance that ApiFeedContributions can consume. Implementors of
386 this hook may cancel the hook to signal that the item is not viewable in the
387 provided context.
388 $row: A row of data from ContribsPager. The set of data returned by
389 ContribsPager can be adjusted by handling the ContribsPager::reallyDoQuery
390 hook.
391 $context: An IContextSource implementation.
392 &$feedItem: Set this to a FeedItem instance if the callback can handle the
393 provided row. This is provided to the hook as a null, if it is non null then
394 another callback has already handled the hook.
395
396 'ApiFormatHighlight': Use to syntax-highlight API pretty-printed output. When
397 highlighting, add output to $context->getOutput() and return false.
398 $context: An IContextSource.
399 $text: Text to be highlighted.
400 $mime: MIME type of $text.
401 $format: API format code for $text.
402
403 'APIGetAllowedParams': Use this hook to modify a module's parameters.
404 &$module: ApiBase Module object
405 &$params: Array of parameters
406 $flags: int zero or OR-ed flags like ApiBase::GET_VALUES_FOR_HELP
407
408 'APIGetDescription': DEPRECATED! Use APIGetDescriptionMessages instead.
409 Use this hook to modify a module's description.
410 &$module: ApiBase Module object
411 &$desc: String description, or array of description strings
412
413 'APIGetDescriptionMessages': Use this hook to modify a module's help message.
414 $module: ApiBase Module object
415 &$msg: Array of Message objects
416
417 'APIGetParamDescription': DEPRECATED! Use APIGetParamDescriptionMessages
418 instead.
419 Use this hook to modify a module's parameter descriptions.
420 &$module: ApiBase Module object
421 &$desc: Array of parameter descriptions
422
423 'APIGetParamDescriptionMessages': Use this hook to modify a module's parameter
424 descriptions.
425 $module: ApiBase Module object
426 &$msg: Array of arrays of Message objects
427
428 'APIHelpModifyOutput': Use this hook to modify an API module's help output.
429 $module: ApiBase Module object
430 &$help: Array of HTML strings to be joined for the output.
431 $options: Array Options passed to ApiHelp::getHelp
432 &$tocData: Array If a TOC is being generated, this array has keys as anchors in
433 the page and values as for Linker::generateTOC().
434
435 'ApiMain::moduleManager': Called when ApiMain has finished initializing its
436 module manager. Can be used to conditionally register API modules.
437 $moduleManager: ApiModuleManager Module manager instance
438
439 'ApiMain::onException': Called by ApiMain::executeActionWithErrorHandling() when
440 an exception is thrown during API action execution.
441 $apiMain: Calling ApiMain instance.
442 $e: Exception object.
443
444 'ApiOpenSearchSuggest': Called when constructing the OpenSearch results. Hooks
445 can alter or append to the array.
446 &$results: array with integer keys to associative arrays. Keys in associative
447 array:
448 - title: Title object.
449 - redirect from: Title or null.
450 - extract: Description for this result.
451 - extract trimmed: If truthy, the extract will not be trimmed to
452 $wgOpenSearchDescriptionLength.
453 - image: Thumbnail for this result. Value is an array with subkeys 'source'
454 (url), 'width', 'height', 'alt', 'align'.
455 - url: Url for the given title.
456
457 'ApiQuery::moduleManager': Called when ApiQuery has finished initializing its
458 module manager. Can be used to conditionally register API query modules.
459 $moduleManager: ApiModuleManager Module manager instance
460
461 'APIQueryAfterExecute': After calling the execute() method of an
462 action=query submodule. Use this to extend core API modules.
463 &$module: Module object
464
465 'APIQueryGeneratorAfterExecute': After calling the executeGenerator() method of
466 an action=query submodule. Use this to extend core API modules.
467 &$module: Module object
468 &$resultPageSet: ApiPageSet object
469
470 'APIQueryInfoTokens': DEPRECATED! Use ApiQueryTokensRegisterTypes instead.
471 Use this hook to add custom tokens to prop=info. Every token has an action,
472 which will be used in the intoken parameter and in the output
473 (actiontoken="..."), and a callback function which should return the token, or
474 false if the user isn't allowed to obtain it. The prototype of the callback
475 function is func($pageid, $title), where $pageid is the page ID of the page the
476 token is requested for and $title is the associated Title object. In the hook,
477 just add your callback to the $tokenFunctions array and return true (returning
478 false makes no sense).
479 &$tokenFunctions: array(action => callback)
480
481 'APIQueryRecentChangesTokens': DEPRECATED! Use ApiQueryTokensRegisterTypes
482 instead.
483 Use this hook to add custom tokens to list=recentchanges. Every token has an
484 action, which will be used in the rctoken parameter and in the output
485 (actiontoken="..."), and a callback function which should return the token, or
486 false if the user isn't allowed to obtain it. The prototype of the callback
487 function is func($pageid, $title, $rc), where $pageid is the page ID of the
488 page associated to the revision the token is requested for, $title the
489 associated Title object and $rc the associated RecentChange object. In the
490 hook, just add your callback to the $tokenFunctions array and return true
491 (returning false makes no sense).
492 &$tokenFunctions: array(action => callback)
493
494 'APIQueryRevisionsTokens': DEPRECATED! Use ApiQueryTokensRegisterTypes instead.
495 Use this hook to add custom tokens to prop=revisions. Every token has an
496 action, which will be used in the rvtoken parameter and in the output
497 (actiontoken="..."), and a callback function which should return the token, or
498 false if the user isn't allowed to obtain it. The prototype of the callback
499 function is func($pageid, $title, $rev), where $pageid is the page ID of the
500 page associated to the revision the token is requested for, $title the
501 associated Title object and $rev the associated Revision object. In the hook,
502 just add your callback to the $tokenFunctions array and return true (returning
503 false makes no sense).
504 &$tokenFunctions: array(action => callback)
505
506 'APIQuerySiteInfoGeneralInfo': Use this hook to add extra information to the
507 sites general information.
508 $module: the current ApiQuerySiteInfo module
509 &$results: array of results, add things here
510
511 'APIQuerySiteInfoStatisticsInfo': Use this hook to add extra information to the
512 sites statistics information.
513 &$results: array of results, add things here
514
515 'ApiQueryTokensRegisterTypes': Use this hook to add additional token types to
516 action=query&meta=tokens. Note that most modules will probably be able to use
517 the 'csrf' token instead of creating their own token types.
518 &$salts: array( type => salt to pass to User::getEditToken() or array of salt
519 and key to pass to Session::getToken() )
520
521 'APIQueryUsersTokens': DEPRECATED! Use ApiQueryTokensRegisterTypes instead.
522 Use this hook to add custom token to list=users. Every token has an action,
523 which will be used in the ustoken parameter and in the output
524 (actiontoken="..."), and a callback function which should return the token, or
525 false if the user isn't allowed to obtain it. The prototype of the callback
526 function is func($user) where $user is the User object. In the hook, just add
527 your callback to the $tokenFunctions array and return true (returning false
528 makes no sense).
529 &$tokenFunctions: array(action => callback)
530
531 'ApiRsdServiceApis': Add or remove APIs from the RSD services list. Each service
532 should have its own entry in the $apis array and have a unique name, passed as
533 key for the array that represents the service data. In this data array, the
534 key-value-pair identified by the apiLink key is required.
535 &$apis: array of services
536
537 'ApiTokensGetTokenTypes': DEPRECATED! Use ApiQueryTokensRegisterTypes instead.
538 Use this hook to extend action=tokens with new token types.
539 &$tokenTypes: supported token types in format 'type' => callback function
540 used to retrieve this type of tokens.
541
542 'Article::MissingArticleConditions': Before fetching deletion & move log entries
543 to display a message of a non-existing page being deleted/moved, give extensions
544 a chance to hide their (unrelated) log entries.
545 &$conds: Array of query conditions (all of which have to be met; conditions will
546 AND in the final query)
547 $logTypes: Array of log types being queried
548
549 'ArticleAfterFetchContent': DEPRECATED! Use ArticleAfterFetchContentObject
550 instead.
551 After fetching content of an article from the database.
552 &$article: the article (object) being loaded from the database
553 &$content: the content (string) of the article
554
555 'ArticleAfterFetchContentObject': After fetching content of an article from the
556 database.
557 &$article: the article (object) being loaded from the database
558 &$content: the content of the article, as a Content object
559
560 'ArticleConfirmDelete': Before writing the confirmation form for article
561 deletion.
562 $article: the article (object) being deleted
563 $output: the OutputPage object
564 &$reason: the reason (string) the article is being deleted
565
566 'ArticleContentOnDiff': Before showing the article content below a diff. Use
567 this to change the content in this area or how it is loaded.
568 $diffEngine: the DifferenceEngine
569 $output: the OutputPage object
570
571 'ArticleContentViewCustom': Allows to output the text of the article in a
572 different format than wikitext. Note that it is preferable to implement proper
573 handing for a custom data type using the ContentHandler facility.
574 $content: content of the page, as a Content object
575 $title: title of the page
576 $output: reference to $wgOut
577
578 'ArticleDelete': Before an article is deleted.
579 &$wikiPage: the WikiPage (object) being deleted
580 &$user: the user (object) deleting the article
581 &$reason: the reason (string) the article is being deleted
582 &$error: if the deletion was prohibited, the (raw HTML) error message to display
583 (added in 1.13)
584 &$status: Status object, modify this to throw an error. Overridden by $error
585 (added in 1.20)
586 $suppress: Whether this is a suppression deletion or not (added in 1.27)
587
588 'ArticleDeleteAfterSuccess': Output after an article has been deleted.
589 $title: Title of the article that has been deleted.
590 $outputPage: OutputPage that can be used to append the output.
591
592 'ArticleDeleteComplete': After an article is deleted.
593 &$wikiPage: the WikiPage that was deleted
594 &$user: the user that deleted the article
595 $reason: the reason the article was deleted
596 $id: id of the article that was deleted
597 $content: the Content of the deleted page
598 $logEntry: the ManualLogEntry used to record the deletion
599
600 'ArticleEditUpdateNewTalk': Before updating user_newtalk when a user talk page
601 was changed.
602 &$wikiPage: WikiPage (object) of the user talk page
603 $recipient: User (object) who's talk page was edited
604
605 'ArticleEditUpdates': When edit updates (mainly link tracking) are made when an
606 article has been changed.
607 &$wikiPage: the WikiPage (object)
608 &$editInfo: data holder that includes the parser output ($editInfo->output) for
609 that page after the change
610 $changed: bool for if the page was changed
611
612 'ArticleEditUpdatesDeleteFromRecentchanges': Before deleting old entries from
613 recentchanges table, return false to not delete old entries.
614 &$wikiPage: WikiPage (object) being modified
615
616 'ArticleFromTitle': when creating an article object from a title object using
617 Wiki::articleFromTitle().
618 &$title: Title (object) used to create the article object
619 &$article: Article (object) that will be returned
620 $context: IContextSource (object)
621
622 'ArticleInsertComplete': DEPRECATED! Use PageContentInsertComplete.
623 After a new article is created.
624 $wikiPage: WikiPage created
625 $user: User creating the article
626 $text: New content
627 $summary: Edit summary/comment
628 $isMinor: Whether or not the edit was marked as minor
629 $isWatch: (No longer used)
630 $section: (No longer used)
631 $flags: Flags passed to WikiPage::doEditContent()
632 $revision: New Revision of the article
633
634 'ArticleMergeComplete': After merging to article using Special:Mergehistory.
635 $targetTitle: target title (object)
636 $destTitle: destination title (object)
637
638 'ArticlePageDataAfter': After loading data of an article from the database.
639 &$wikiPage: WikiPage (object) whose data were loaded
640 &$row: row (object) returned from the database server
641
642 'ArticlePageDataBefore': Before loading data of an article from the database.
643 &$wikiPage: WikiPage (object) that data will be loaded
644 &$fields: fields (array) to load from the database
645
646 'ArticlePrepareTextForEdit': Called when preparing text to be saved.
647 $wikiPage: the WikiPage being saved
648 $popts: parser options to be used for pre-save transformation
649
650 'ArticleProtect': Before an article is protected.
651 &$wikiPage: the WikiPage being protected
652 &$user: the user doing the protection
653 $protect: Set of restriction keys
654 $reason: Reason for protect
655
656 'ArticleProtectComplete': After an article is protected.
657 &$wikiPage: the WikiPage that was protected
658 &$user: the user who did the protection
659 $protect: Set of restriction keys
660 $reason: Reason for protect
661
662 'ArticlePurge': Before executing "&action=purge".
663 &$wikiPage: WikiPage (object) to purge
664
665 'ArticleRevisionUndeleted': After an article revision is restored.
666 &$title: the article title
667 $revision: the revision
668 $oldPageID: the page ID of the revision when archived (may be null)
669
670 'ArticleRevisionVisibilitySet': Called when changing visibility of one or more
671 revisions of an article.
672 $title: Title object of the article
673 $ids: Ids to set the visibility for
674
675 'ArticleRollbackComplete': After an article rollback is completed.
676 $wikiPage: the WikiPage that was edited
677 $user: the user who did the rollback
678 $revision: the revision the page was reverted back to
679 $current: the reverted revision
680
681 'ArticleSave': DEPRECATED! Use PageContentSave instead.
682 Before an article is saved.
683 $wikiPage: the WikiPage (object) being saved
684 $user: the user (object) saving the article
685 $text: the new article text
686 $summary: the article summary (comment)
687 $isminor: minor flag
688 $iswatch: watch flag
689 $section: section #
690
691 'ArticleSaveComplete': DEPRECATED! Use PageContentSaveComplete instead.
692 After an article has been updated.
693 $wikiPage: WikiPage modified
694 $user: User performing the modification
695 $text: New content
696 $summary: Edit summary/comment
697 $isMinor: Whether or not the edit was marked as minor
698 $isWatch: (No longer used)
699 $section: (No longer used)
700 $flags: Flags passed to WikiPage::doEditContent()
701 $revision: New Revision of the article
702 $status: Status object about to be returned by doEditContent()
703 $baseRevId: the rev ID (or false) this edit was based on
704
705 'ArticleUndelete': When one or more revisions of an article are restored.
706 &$title: Title corresponding to the article restored
707 $create: Whether or not the restoration caused the page to be created (i.e. it
708 didn't exist before).
709 $comment: The comment associated with the undeletion.
710 $oldPageId: ID of page previously deleted (from archive table)
711
712 'ArticleUndeleteLogEntry': When a log entry is generated but not yet saved.
713 $pageArchive: the PageArchive object
714 &$logEntry: ManualLogEntry object
715 $user: User who is performing the log action
716
717 'ArticleUpdateBeforeRedirect': After a page is updated (usually on save), before
718 the user is redirected back to the page.
719 $article: the article
720 &$sectionanchor: The section anchor link (e.g. "#overview" )
721 &$extraq: Extra query parameters which can be added via hooked functions
722
723 'ArticleViewCustom': DEPRECATED! Use ArticleContentViewCustom instead.
724 Allows to output the text of the article in a different format than wikitext.
725 Note that it is preferable to implement proper handing for a custom data type
726 using the ContentHandler facility.
727 $text: text of the page
728 $title: title of the page
729 $output: reference to $wgOut
730
731 'ArticleViewFooter': After showing the footer section of an ordinary page view
732 $article: Article object
733 $patrolFooterShown: boolean whether patrol footer is shown
734
735 'ArticleViewHeader': Before the parser cache is about to be tried for article
736 viewing.
737 &$article: the article
738 &$pcache: whether to try the parser cache or not
739 &$outputDone: whether the output for this page finished or not. Set to
740 a ParserOutput object to both indicate that the output is done and what
741 parser output was used.
742
743 'ArticleViewRedirect': Before setting "Redirected from ..." subtitle when a
744 redirect was followed.
745 &$article: target article (object)
746
747 'AuthPluginAutoCreate': DEPRECATED! Use the 'LocalUserCreated' hook instead.
748 Called when creating a local account for an user logged in from an external
749 authentication method.
750 $user: User object created locally
751
752 'AuthPluginSetup': Update or replace authentication plugin object ($wgAuth).
753 Gives a chance for an extension to set it programmatically to a variable class.
754 &$auth: the $wgAuth object, probably a stub
755
756 'AutopromoteCondition': Check autopromote condition for user.
757 $type: condition type
758 $args: arguments
759 $user: user
760 &$result: result of checking autopromote condition
761
762 'BacklinkCacheGetConditions': Allows to set conditions for query when links to
763 certain title are fetched.
764 $table: table name
765 $title: title of the page to which backlinks are sought
766 &$conds: query conditions
767
768 'BacklinkCacheGetPrefix': Allows to set prefix for a specific link table.
769 $table: table name
770 &$prefix: prefix
771
772 'BadImage': When checking against the bad image list. Change $bad and return
773 false to override. If an image is "bad", it is not rendered inline in wiki
774 pages or galleries in category pages.
775 $name: Image name being checked
776 &$bad: Whether or not the image is "bad"
777
778 'BaseTemplateAfterPortlet': After output of portlets, allow injecting
779 custom HTML after the section. Any uses of the hook need to handle escaping.
780 $template: BaseTemplate
781 $portlet: string portlet name
782 &$html: string
783
784 'BaseTemplateToolbox': Called by BaseTemplate when building the $toolbox array
785 and returning it for the skin to output. You can add items to the toolbox while
786 still letting the skin make final decisions on skin-specific markup conventions
787 using this hook.
788 &$sk: The BaseTemplate base skin template
789 &$toolbox: An array of toolbox items, see BaseTemplate::getToolbox and
790 BaseTemplate::makeListItem for details on the format of individual items
791 inside of this array.
792
793 'BeforeDisplayNoArticleText': Before displaying message key "noarticletext" or
794 "noarticletext-nopermission" at Article::showMissingArticle().
795 $article: article object
796
797 'BeforeHttpsRedirect': Prior to forcing HTTP->HTTPS redirect. Gives a chance to
798 override how the redirect is output by modifying, or by returning false, and
799 letting standard HTTP rendering take place.
800 ATTENTION: This hook is likely to be removed soon due to overall design of the
801 system.
802 $context: IContextSource object
803 &$redirect: string URL, modifiable
804
805 'BeforeInitialize': Before anything is initialized in
806 MediaWiki::performRequest().
807 &$title: Title being used for request
808 &$unused: null
809 &$output: OutputPage object
810 &$user: User
811 $request: WebRequest object
812 $mediaWiki: Mediawiki object
813
814 'BeforePageDisplay': Prior to outputting a page.
815 &$out: OutputPage object
816 &$skin: Skin object
817
818 'BeforePageRedirect': Prior to sending an HTTP redirect. Gives a chance to
819 override how the redirect is output by modifying, or by returning false and
820 taking over the output.
821 $out: OutputPage object
822 &$redirect: URL, modifiable
823 &$code: HTTP code (eg '301' or '302'), modifiable
824
825 'BeforeParserFetchFileAndTitle': Before an image is rendered by Parser.
826 $parser: Parser object
827 $nt: the image title
828 &$options: array of options to RepoGroup::findFile. If it contains 'broken'
829 as a key then the file will appear as a broken thumbnail.
830 &$descQuery: query string to add to thumbnail URL
831
832 'BeforeParserFetchTemplateAndtitle': Before a template is fetched by Parser.
833 $parser: Parser object
834 $title: title of the template
835 &$skip: skip this template and link it?
836 &$id: the id of the revision being parsed
837
838 'BeforeParserrenderImageGallery': Before an image gallery is rendered by Parser.
839 &$parser: Parser object
840 &$ig: ImageGallery object
841
842 'BeforeWelcomeCreation': Before the welcomecreation message is displayed to a
843 newly created user.
844 &$welcome_creation_msg: MediaWiki message name to display on the welcome screen
845 to a newly created user account.
846 &$injected_html: Any HTML to inject after the "logged in" message of a newly
847 created user account
848
849 'BitmapHandlerCheckImageArea': By BitmapHandler::normaliseParams, after all
850 normalizations have been performed, except for the $wgMaxImageArea check.
851 $image: File
852 &$params: Array of parameters
853 &$checkImageAreaHookResult: null, set to true or false to override the
854 $wgMaxImageArea check result.
855
856 'BitmapHandlerTransform': before a file is transformed, gives extension the
857 possibility to transform it themselves
858 $handler: BitmapHandler
859 $image: File
860 &$scalerParams: Array with scaler parameters
861 &$mto: null, set to a MediaTransformOutput
862
863 'BlockIp': Before an IP address or user is blocked.
864 &$block: the Block object about to be saved
865 &$user: the user _doing_ the block (not the one being blocked)
866 &$reason: if the hook is aborted, the error message to be returned in an array
867
868 'BlockIpComplete': After an IP address or user is blocked.
869 $block: the Block object that was saved
870 $user: the user who did the block (not the one being blocked)
871
872 'BookInformation': Before information output on Special:Booksources.
873 $isbn: ISBN to show information for
874 $output: OutputPage object in use
875
876 'CanIPUseHTTPS': Determine whether the client at a given source IP is likely
877 to be able to access the wiki via HTTPS.
878 $ip: The IP address in human-readable form
879 &$canDo: This reference should be set to false if the client may not be able
880 to use HTTPS
881
882 'CanonicalNamespaces': For extensions adding their own namespaces or altering
883 the defaults.
884 Note that if you need to specify namespace protection or content model for
885 a namespace that is added in a CanonicalNamespaces hook handler, you
886 should do so by altering $wgNamespaceProtection and
887 $wgNamespaceContentModels outside the handler, in top-level scope. The
888 point at which the CanonicalNamespaces hook fires is too late for altering
889 these variables. This applies even if the namespace addition is
890 conditional; it is permissible to declare a content model and protection
891 for a namespace and then decline to actually register it.
892 &$namespaces: Array of namespace numbers with corresponding canonical names
893
894 'CategoryAfterPageAdded': After a page is added to a category.
895 $category: Category that page was added to
896 $wikiPage: WikiPage that was added
897
898 'CategoryAfterPageRemoved': After a page is removed from a category.
899 $category: Category that page was removed from
900 $wikiPage: WikiPage that was removed
901
902 'CategoryPageView': Before viewing a categorypage in CategoryPage::view.
903 &$catpage: CategoryPage instance
904
905 'CategoryViewer::doCategoryQuery': After querying for pages to be displayed
906 in a Category page. Gives extensions the opportunity to batch load any
907 related data about the pages.
908 $type: The category type. Either 'page', 'file' or 'subcat'
909 $res: Query result from DatabaseBase::select()
910
911 'CategoryViewer::generateLink': Before generating an output link allow
912 extensions opportunity to generate a more specific or relevant link.
913 $type: The category type. Either 'page', 'img' or 'subcat'
914 $title: Title object for the categorized page
915 $html: Requested html content of anchor
916 &$link: Returned value. When set to a non-null value by a hook subscriber
917 this value will be used as the anchor instead of Linker::link
918
919 'ChangePasswordForm': For extensions that need to add a field to the
920 ChangePassword form via the Preferences form.
921 &$extraFields: An array of arrays that hold fields like would be passed to the
922 pretty function.
923
924 'ChangesListInitRows': Batch process change list rows prior to rendering.
925 $changesList: ChangesList instance
926 $rows: The data that will be rendered. May be a ResultWrapper instance or
927 an array.
928
929 'ChangesListInsertArticleLink': Override or augment link to article in RC list.
930 &$changesList: ChangesList instance.
931 &$articlelink: HTML of link to article (already filled-in).
932 &$s: HTML of row that is being constructed.
933 &$rc: RecentChange instance.
934 $unpatrolled: Whether or not we are showing unpatrolled changes.
935 $watched: Whether or not the change is watched by the user.
936
937 'ChangesListSpecialPageFilters': Called after building form options on pages
938 inheriting from ChangesListSpecialPage (in core: RecentChanges,
939 RecentChangesLinked and Watchlist).
940 $special: ChangesListSpecialPage instance
941 &$filters: associative array of filter definitions. The keys are the HTML
942 name/URL parameters. Each key maps to an associative array with a 'msg'
943 (message key) and a 'default' value.
944
945 'ChangesListSpecialPageQuery': Called when building SQL query on pages
946 inheriting from ChangesListSpecialPage (in core: RecentChanges,
947 RecentChangesLinked and Watchlist).
948 $name: name of the special page, e.g. 'Watchlist'
949 &$tables: array of tables to be queried
950 &$fields: array of columns to select
951 &$conds: array of WHERE conditionals for query
952 &$query_options: array of options for the database request
953 &$join_conds: join conditions for the tables
954 $opts: FormOptions for this request
955
956 'ChangeTagAfterDelete': Called after a change tag has been deleted (that is,
957 removed from all revisions and log entries to which it was applied). This gives
958 extensions a chance to take it off their books.
959 $tag: name of the tag
960 &$status: Status object. Add warnings to this as required. There is no point
961 setting errors, as the deletion has already been partly carried out by this
962 point.
963
964 'ChangeTagCanCreate': Tell whether a change tag should be able to be created
965 from the UI (Special:Tags) or via the API. You could use this hook if you want
966 to reserve a specific "namespace" of tags, or something similar.
967 $tag: name of the tag
968 $user: user initiating the action
969 &$status: Status object. Add your errors using `$status->fatal()` or warnings
970 using `$status->warning()`. Errors and warnings will be relayed to the user.
971 If you set an error, the user will be unable to create the tag.
972
973 'ChangeTagCanDelete': Tell whether a change tag should be able to be
974 deleted from the UI (Special:Tags) or via the API. The default is that tags
975 defined using the ListDefinedTags hook are not allowed to be deleted unless
976 specifically allowed. If you wish to allow deletion of the tag, set
977 `$status = Status::newGood()` to allow deletion, and then `return false` from
978 the hook function. Ensure you consume the 'ChangeTagAfterDelete' hook to carry
979 out custom deletion actions.
980 $tag: name of the tag
981 $user: user initiating the action
982 &$status: Status object. See above.
983
984 'ChangeTagsListActive': Allows you to nominate which of the tags your extension
985 uses are in active use.
986 &$tags: list of all active tags. Append to this array.
987
988 'Collation::factory': Called if $wgCategoryCollation is an unknown collation.
989 $collationName: Name of the collation in question
990 &$collationObject: Null. Replace with a subclass of the Collation class that
991 implements the collation given in $collationName.
992
993 'ConfirmEmailComplete': Called after a user's email has been confirmed
994 successfully.
995 $user: user (object) whose email is being confirmed
996
997 'ContentAlterParserOutput': Modify parser output for a given content object.
998 Called by Content::getParserOutput after parsing has finished. Can be used
999 for changes that depend on the result of the parsing but have to be done
1000 before LinksUpdate is called (such as adding tracking categories based on
1001 the rendered HTML).
1002 $content: The Content to render
1003 $title: Title of the page, as context
1004 $parserOutput: ParserOutput to manipulate
1005
1006 'ContentGetParserOutput': Customize parser output for a given content object,
1007 called by AbstractContent::getParserOutput. May be used to override the normal
1008 model-specific rendering of page content.
1009 $content: The Content to render
1010 $title: Title of the page, as context
1011 $revId: The revision ID, as context
1012 $options: ParserOptions for rendering. To avoid confusing the parser cache,
1013 the output can only depend on parameters provided to this hook function, not
1014 on global state.
1015 $generateHtml: boolean, indicating whether full HTML should be generated. If
1016 false, generation of HTML may be skipped, but other information should still
1017 be present in the ParserOutput object.
1018 &$output: ParserOutput, to manipulate or replace
1019
1020 'ContentHandlerDefaultModelFor': Called when the default content model is
1021 determined for a given title. May be used to assign a different model for that
1022 title.
1023 $title: the Title in question
1024 &$model: the model name. Use with CONTENT_MODEL_XXX constants.
1025
1026 'ContentHandlerForModelID': Called when a ContentHandler is requested for
1027 a given content model name, but no entry for that model exists in
1028 $wgContentHandlers.
1029 $modeName: the requested content model name
1030 &$handler: set this to a ContentHandler object, if desired.
1031
1032 'ContentModelCanBeUsedOn': Called to determine whether that content model can
1033 be used on a given page. This is especially useful to prevent some content
1034 models to be used in some special location.
1035 $contentModel: ID of the content model in question
1036 $title: the Title in question.
1037 &$ok: Output parameter, whether it is OK to use $contentModel on $title.
1038 Handler functions that modify $ok should generally return false to prevent
1039 further hooks from further modifying $ok.
1040
1041 'ContribsPager::getQueryInfo': Before the contributions query is about to run
1042 &$pager: Pager object for contributions
1043 &$queryInfo: The query for the contribs Pager
1044
1045 'ContribsPager::reallyDoQuery': Called before really executing the query for My
1046 Contributions
1047 &$data: an array of results of all contribs queries
1048 $pager: The ContribsPager object hooked into
1049 $offset: Index offset, inclusive
1050 $limit: Exact query limit
1051 $descending: Query direction, false for ascending, true for descending
1052
1053 'ContributionsLineEnding': Called before a contributions HTML line is finished
1054 $page: SpecialPage object for contributions
1055 &$ret: the HTML line
1056 $row: the DB row for this line
1057 &$classes: the classes to add to the surrounding <li>
1058
1059 'ContributionsToolLinks': Change tool links above Special:Contributions
1060 $id: User identifier
1061 $title: User page title
1062 &$tools: Array of tool links
1063
1064 'ConvertContent': Called by AbstractContent::convert when a conversion to
1065 another content model is requested.
1066 Handler functions that modify $result should generally return false to disable
1067 further attempts at conversion.
1068 $content: The Content object to be converted.
1069 $toModel: The ID of the content model to convert to.
1070 $lossy: boolean indicating whether lossy conversion is allowed.
1071 &$result: Output parameter, in case the handler function wants to provide a
1072 converted Content object. Note that $result->getContentModel() must return
1073 $toModel.
1074
1075 'CustomEditor': When invoking the page editor
1076 Return true to allow the normal editor to be used, or false if implementing
1077 a custom editor, e.g. for a special namespace, etc.
1078 $article: Article being edited
1079 $user: User performing the edit
1080
1081 'DatabaseOraclePostInit': Called after initialising an Oracle database
1082 $db: the DatabaseOracle object
1083
1084 'DeletedContribsPager::reallyDoQuery': Called before really executing the query
1085 for Special:DeletedContributions
1086 Similar to ContribsPager::reallyDoQuery
1087 &$data: an array of results of all contribs queries
1088 $pager: The DeletedContribsPager object hooked into
1089 $offset: Index offset, inclusive
1090 $limit: Exact query limit
1091 $descending: Query direction, false for ascending, true for descending
1092
1093 'DeletedContributionsLineEnding': Called before a DeletedContributions HTML line
1094 is finished.
1095 Similar to ContributionsLineEnding
1096 $page: SpecialPage object for DeletedContributions
1097 &$ret: the HTML line
1098 $row: the DB row for this line
1099 &$classes: the classes to add to the surrounding <li>
1100
1101 'DiffRevisionTools': Override or extend the revision tools available from the
1102 diff view, i.e. undo, etc.
1103 $newRev: Revision object of the "new" revision
1104 &$links: Array of HTML links
1105 $oldRev: Revision object of the "old" revision (may be null)
1106 $user: Current user object
1107
1108 'DiffViewHeader': Called before diff display
1109 $diff: DifferenceEngine object that's calling
1110 $oldRev: Revision object of the "old" revision (may be null/invalid)
1111 $newRev: Revision object of the "new" revision
1112
1113 'DisplayOldSubtitle': before creating subtitle when browsing old versions of
1114 an article
1115 &$article: article (object) being viewed
1116 &$oldid: oldid (int) being viewed
1117
1118 'DoEditSectionLink': DEPRECATED! Use SkinEditSectionLinks instead.
1119 Override the HTML generated for section edit links
1120 $skin: Skin object rendering the UI
1121 $title: Title object for the title being linked to (may not be the same as
1122 the page title, if the section is included from a template)
1123 $section: The designation of the section being pointed to, to be included in
1124 the link, like "&section=$section"
1125 $tooltip: The default tooltip. Escape before using.
1126 By default, this is wrapped in the 'editsectionhint' message.
1127 &$result: The HTML to return, prefilled with the default plus whatever other
1128 changes earlier hooks have made
1129 $lang: The language code to use for the link in the wfMessage function
1130
1131 'EditFilter': Perform checks on an edit
1132 $editor: EditPage instance (object). The edit form (see includes/EditPage.php)
1133 $text: Contents of the edit box
1134 $section: Section being edited
1135 &$error: Error message to return
1136 $summary: Edit summary for page
1137
1138 'EditFilterMerged': DEPRECATED! Use EditFilterMergedContent instead.
1139 Post-section-merge edit filter.
1140 $editor: EditPage instance (object)
1141 $text: content of the edit box
1142 &$error: error message to return
1143 $summary: Edit summary for page
1144
1145 'EditFilterMergedContent': Post-section-merge edit filter.
1146 This may be triggered by the EditPage or any other facility that modifies page
1147 content. Use the $status object to indicate whether the edit should be allowed,
1148 and to provide a reason for disallowing it. Return false to abort the edit, and
1149 true to continue. Returning true if $status->isOK() returns false means "don't
1150 save but continue user interaction", e.g. show the edit form.
1151 $status->apiHookResult can be set to an array to be returned by api.php
1152 action=edit. This is used to deliver captchas.
1153 $context: object implementing the IContextSource interface.
1154 $content: content of the edit box, as a Content object.
1155 $status: Status object to represent errors, etc.
1156 $summary: Edit summary for page
1157 $user: the User object representing the user whois performing the edit.
1158 $minoredit: whether the edit was marked as minor by the user.
1159
1160 'EditFormInitialText': Allows modifying the edit form when editing existing
1161 pages
1162 $editPage: EditPage object
1163
1164 'EditFormPreloadText': Allows population of the edit form when creating
1165 new pages
1166 &$text: Text to preload with
1167 &$title: Title object representing the page being created
1168
1169 'EditPage::attemptSave': Called before an article is
1170 saved, that is before WikiPage::doEditContent() is called
1171 $editpage_Obj: the current EditPage object
1172
1173 'EditPage::attemptSave:after': Called after an article save attempt
1174 $editpage_Obj: the current EditPage object
1175 $status: the resulting Status object
1176 $resultDetails: Result details array
1177
1178 'EditPage::importFormData': allow extensions to read additional data
1179 posted in the form
1180 $editpage: EditPage instance
1181 $request: Webrequest
1182 return value is ignored (should always return true)
1183
1184 'EditPage::showEditForm:fields': allows injection of form field into edit form
1185 Return value is ignored (should always return true)
1186 &$editor: the EditPage instance for reference
1187 &$out: an OutputPage instance to write to
1188
1189 'EditPage::showEditForm:initial': before showing the edit form
1190 Return false to halt editing; you'll need to handle error messages, etc.
1191 yourself. Alternatively, modifying $error and returning true will cause the
1192 contents of $error to be echoed at the top of the edit form as wikitext.
1193 Return true without altering $error to allow the edit to proceed.
1194 &$editor: EditPage instance (object)
1195 &$out: an OutputPage instance to write to
1196
1197 'EditPage::showReadOnlyForm:initial': similar to EditPage::showEditForm:initial
1198 but for the read-only 'view source' variant of the edit form.
1199 Return value is ignored (should always return true)
1200 $editor: EditPage instance (object)
1201 &$out: an OutputPage instance to write to
1202
1203 'EditPage::showStandardInputs:options': allows injection of form fields into
1204 the editOptions area
1205 Return value is ignored (should always be true)
1206 $editor: EditPage instance (object)
1207 $out: an OutputPage instance to write to
1208 &$tabindex: HTML tabindex of the last edit check/button
1209
1210 'EditPageBeforeConflictDiff': allows modifying the EditPage object and output
1211 when there's an edit conflict. Return false to halt normal diff output; in
1212 this case you're responsible for computing and outputting the entire "conflict"
1213 part, i.e., the "difference between revisions" and "your text" headers and
1214 sections.
1215 &$editor: EditPage instance
1216 &$out: OutputPage instance
1217
1218 'EditPageBeforeEditButtons': Allows modifying the edit buttons below the
1219 textarea in the edit form.
1220 &$editpage: The current EditPage object
1221 &$buttons: Array of edit buttons "Save", "Preview", "Live", and "Diff"
1222 &$tabindex: HTML tabindex of the last edit check/button
1223
1224 'EditPageBeforeEditChecks': Allows modifying the edit checks below the textarea
1225 in the edit form.
1226 &$editpage: The current EditPage object
1227 &$checks: Array of edit checks like "watch this page"/"minor edit"
1228 &$tabindex: HTML tabindex of the last edit check/button
1229
1230 'EditPageBeforeEditToolbar': Allows modifying the edit toolbar above the
1231 textarea in the edit form.
1232 &$toolbar: The toolbar HTMl
1233
1234 'EditPageCopyrightWarning': Allow for site and per-namespace customization of
1235 contribution/copyright notice.
1236 $title: title of page being edited
1237 &$msg: localization message name, overridable. Default is either
1238 'copyrightwarning' or 'copyrightwarning2'.
1239
1240 'EditPageGetDiffContent': Allow modifying the wikitext that will be used in
1241 "Show changes". Note that it is preferable to implement diff handling for
1242 different data types using the ContentHandler facility.
1243 $editPage: EditPage object
1244 &$newtext: wikitext that will be used as "your version"
1245
1246 'EditPageGetDiffText': DEPRECATED! Use EditPageGetDiffContent instead.
1247 Allow modifying the wikitext that will be used in "Show changes". Note that it
1248 is preferable to implement diff handling for different data types using the
1249 ContentHandler facility.
1250 $editPage: EditPage object
1251 &$newtext: wikitext that will be used as "your version"
1252
1253 'EditPageGetPreviewContent': Allow modifying the wikitext that will be
1254 previewed. Note that it is preferable to implement previews for different data
1255 types using the ContentHandler facility.
1256 $editPage: EditPage object
1257 &$content: Content object to be previewed (may be replaced by hook function)
1258
1259 'EditPageGetPreviewText': DEPRECATED! Use EditPageGetPreviewContent instead.
1260 Allow modifying the wikitext that will be previewed. Note that it is preferable
1261 to implement previews for different data types using the ContentHandler
1262 facility.
1263 $editPage: EditPage object
1264 &$toparse: wikitext that will be parsed
1265
1266 'EditPageNoSuchSection': When a section edit request is given for an
1267 non-existent section
1268 &$editpage: The current EditPage object
1269 &$res: the HTML of the error text
1270
1271 'EditPageTosSummary': Give a chance for site and per-namespace customizations
1272 of terms of service summary link that might exist separately from the copyright
1273 notice.
1274 $title: title of page being edited
1275 &$msg: localization message name, overridable. Default is 'editpage-tos-summary'
1276
1277 'EmailConfirmed': When checking that the user's email address is "confirmed".
1278 This runs before the other checks, such as anonymity and the real check; return
1279 true to allow those checks to occur, and false if checking is done.
1280 &$user: User being checked
1281 &$confirmed: Whether or not the email address is confirmed
1282
1283 'EmailUser': Before sending email from one user to another.
1284 &$to: MailAddress object of receiving user
1285 &$from: MailAddress object of sending user
1286 &$subject: subject of the mail
1287 &$text: text of the mail
1288 &$error: Out-param for an error
1289
1290 'EmailUserCC': Before sending the copy of the email to the author.
1291 &$to: MailAddress object of receiving user
1292 &$from: MailAddress object of sending user
1293 &$subject: subject of the mail
1294 &$text: text of the mail
1295
1296 'EmailUserComplete': After sending email from one user to another.
1297 $to: MailAddress object of receiving user
1298 $from: MailAddress object of sending user
1299 $subject: subject of the mail
1300 $text: text of the mail
1301
1302 'EmailUserForm': After building the email user form object.
1303 &$form: HTMLForm object
1304
1305 'EmailUserPermissionsErrors': to retrieve permissions errors for emailing a
1306 user.
1307 $user: The user who is trying to email another user.
1308 $editToken: The user's edit token.
1309 &$hookErr: Out-param for the error. Passed as the parameters to
1310 OutputPage::showErrorPage.
1311
1312 'EnhancedChangesList::getLogText': to alter, remove or add to the links of a
1313 group of changes in EnhancedChangesList.
1314 Hook subscribers can return false to omit this line from recentchanges.
1315 $changesList: EnhancedChangesList object
1316 &$links: The links that were generated by EnhancedChangesList
1317 $block: The RecentChanges objects in that block
1318
1319 'EnhancedChangesListModifyLineData': to alter data used to build
1320 a grouped recent change inner line in EnhancedChangesList.
1321 Hook subscribers can return false to omit this line from recentchanges.
1322 $changesList: EnhancedChangesList object
1323 &$data: An array with all the components that will be joined in order to create the line
1324 $block: An array of RecentChange objects in that block
1325 $rc: The RecentChange object for this line
1326
1327 'EnhancedChangesListModifyBlockLineData': to alter data used to build
1328 a non-grouped recent change line in EnhancedChangesList.
1329 $changesList: EnhancedChangesList object
1330 &$data: An array with all the components that will be joined in order to create the line
1331 $rc: The RecentChange object for this line
1332
1333 'ExemptFromAccountCreationThrottle': Exemption from the account creation
1334 throttle.
1335 $ip: The ip address of the user
1336
1337 'ExtensionTypes': Called when generating the extensions credits, use this to
1338 change the tables headers.
1339 &$extTypes: associative array of extensions types
1340
1341 'ExtractThumbParameters': DEPRECATED! Media handler should override
1342 MediaHandler::parseParamString instead.
1343 Called when extracting thumbnail parameters from a thumbnail file name.
1344 $thumbname: the base name of the thumbnail file
1345 &$params: the currently extracted params (has source name, temp or archived
1346 zone)
1347
1348 'FetchChangesList': When fetching the ChangesList derivative for a particular
1349 user.
1350 $user: User the list is being fetched for
1351 &$skin: Skin object to be used with the list
1352 &$list: List object (defaults to NULL, change it to an object instance and
1353 return false override the list derivative used)
1354
1355 'FileDeleteComplete': When a file is deleted.
1356 &$file: reference to the deleted file
1357 &$oldimage: in case of the deletion of an old image, the name of the old file
1358 &$article: in case all revisions of the file are deleted a reference to the
1359 WikiFilePage associated with the file.
1360 &$user: user who performed the deletion
1361 &$reason: reason
1362
1363 'FileTransformed': When a file is transformed and moved into storage.
1364 $file: reference to the File object
1365 $thumb: the MediaTransformOutput object
1366 $tmpThumbPath: The temporary file system path of the transformed file
1367 $thumbPath: The permanent storage path of the transformed file
1368
1369 'FileUndeleteComplete': When a file is undeleted
1370 $title: title object to the file
1371 $fileVersions: array of undeleted versions. Empty if all versions were restored
1372 $user: user who performed the undeletion
1373 $reason: reason
1374
1375 'FileUpload': When a file upload occurs.
1376 $file: Image object representing the file that was uploaded
1377 $reupload: Boolean indicating if there was a previously another image there or
1378 not (since 1.17)
1379 $hasDescription: Boolean indicating that there was already a description page
1380 and a new one from the comment wasn't created (since 1.17)
1381
1382 'FormatAutocomments': When an autocomment is formatted by the Linker.
1383 &$comment: Reference to the accumulated comment. Initially null, when set the
1384 default code will be skipped.
1385 $pre: Boolean, true if there is text before this autocomment
1386 $auto: The extracted part of the parsed comment before the call to the hook.
1387 $post: Boolean, true if there is text after this autocomment
1388 $title: An optional title object used to links to sections. Can be null.
1389 $local: Boolean indicating whether section links should refer to local page.
1390 $wikiId: String containing the ID (as used by WikiMap) of the wiki from which the
1391 autocomment originated; null for the local wiki. Added in 1.26, should default
1392 to null in handler functions, for backwards compatibility.
1393
1394 'GalleryGetModes': Get list of classes that can render different modes of a
1395 gallery.
1396 &$modeArray: An associative array mapping mode names to classes that implement
1397 that mode. It is expected all registered classes are a subclass of
1398 ImageGalleryBase.
1399
1400 'GetAutoPromoteGroups': When determining which autopromote groups a user is
1401 entitled to be in.
1402 $user: user to promote.
1403 &$promote: groups that will be added.
1404
1405 'GetBlockedStatus': after loading blocking status of an user from the database
1406 &$user: user (object) being checked
1407
1408 'GetCacheVaryCookies': Get cookies that should vary cache options.
1409 $out: OutputPage object
1410 &$cookies: array of cookies name, add a value to it if you want to add a cookie
1411 that have to vary cache options
1412
1413 'GetCanonicalURL': Modify fully-qualified URLs used for IRC and e-mail
1414 notifications.
1415 &$title: Title object of page
1416 &$url: string value as output (out parameter, can modify)
1417 $query: query options passed to Title::getCanonicalURL()
1418
1419 'GetDefaultSortkey': Override the default sortkey for a page.
1420 $title: Title object that we need to get a sortkey for
1421 &$sortkey: Sortkey to use.
1422
1423 'GetDifferenceEngine': Called when getting a new difference engine interface
1424 object Return false for valid object in $differenceEngine or true for the
1425 default difference engine.
1426 $context: IContextSource context to be used for diff
1427 $old: Revision ID to show and diff with
1428 $new: Either a revision ID or one of the strings 'cur', 'prev' or 'next'
1429 $refreshCache: If set, refreshes the diff cache
1430 $unhide: If set, allow viewing deleted revs
1431 &$differenceEngine: output parameter, difference engine object to be used for
1432 diff
1433
1434 'GetDoubleUnderscoreIDs': Modify the list of behavior switch (double
1435 underscore) magic words. Called by MagicWord.
1436 &$doubleUnderscoreIDs: array of strings
1437
1438 'GetExtendedMetadata': Get extended file metadata for the API
1439 &$combinedMeta: Array of the form:
1440 'MetadataPropName' => array(
1441 value' => prop value,
1442 'source' => 'name of hook'
1443 ).
1444 $file: File object of file in question
1445 $context: RequestContext (including language to use)
1446 $single: Only extract the current language; if false, the prop value should
1447 be in the metadata multi-language array format:
1448 mediawiki.org/wiki/Manual:File_metadata_handling#Multi-language_array_format
1449 &$maxCacheTime: how long the results can be cached
1450
1451 'GetFullURL': Modify fully-qualified URLs used in redirects/export/offsite data.
1452 &$title: Title object of page
1453 &$url: string value as output (out parameter, can modify)
1454 $query: query options passed to Title::getFullURL()
1455
1456 'GetHumanTimestamp': Pre-emptively override the human-readable timestamp
1457 generated by MWTimestamp::getHumanTimestamp(). Return false in this hook to use
1458 the custom output.
1459 &$output: string for the output timestamp
1460 $timestamp: MWTimestamp object of the current (user-adjusted) timestamp
1461 $relativeTo: MWTimestamp object of the relative (user-adjusted) timestamp
1462 $user: User whose preferences are being used to make timestamp
1463 $lang: Language that will be used to render the timestamp
1464
1465 'GetInternalURL': Modify fully-qualified URLs used for squid cache purging.
1466 &$title: Title object of page
1467 &$url: string value as output (out parameter, can modify)
1468 $query: query options passed to Title::getInternalURL()
1469
1470 'GetIP': modify the ip of the current user (called only once).
1471 &$ip: string holding the ip as determined so far
1472
1473 'GetLinkColours': modify the CSS class of an array of page links.
1474 $linkcolour_ids: array of prefixed DB keys of the pages linked to,
1475 indexed by page_id.
1476 &$colours: (output) array of CSS classes, indexed by prefixed DB keys
1477
1478 'GetLocalURL': Modify local URLs as output into page links. Note that if you are
1479 working with internal urls (non-interwiki) then it may be preferable to work
1480 with the GetLocalURL::Internal or GetLocalURL::Article hooks as GetLocalURL can
1481 be buggy for internal urls on render if you do not re-implement the horrible
1482 hack that Title::getLocalURL uses in your own extension.
1483 &$title: Title object of page
1484 &$url: string value as output (out parameter, can modify)
1485 $query: query options passed to Title::getLocalURL()
1486
1487 'GetLocalURL::Article': Modify local URLs specifically pointing to article paths
1488 without any fancy queries or variants.
1489 &$title: Title object of page
1490 &$url: string value as output (out parameter, can modify)
1491
1492 'GetLocalURL::Internal': Modify local URLs to internal pages.
1493 &$title: Title object of page
1494 &$url: string value as output (out parameter, can modify)
1495 $query: query options passed to Title::getLocalURL()
1496
1497 'GetLogTypesOnUser': Add log types where the target is a userpage
1498 &$types: Array of log types
1499
1500 'GetMetadataVersion': Modify the image metadata version currently in use. This
1501 is used when requesting image metadata from a ForeignApiRepo. Media handlers
1502 that need to have versioned metadata should add an element to the end of the
1503 version array of the form 'handler_name=version'. Most media handlers won't need
1504 to do this unless they broke backwards compatibility with a previous version of
1505 the media handler metadata output.
1506 &$version: Array of version strings
1507
1508 'GetNewMessagesAlert': Disable or modify the new messages alert
1509 &$newMessagesAlert: An empty string by default. If the user has new talk page
1510 messages, this should be populated with an alert message to that effect
1511 $newtalks: An empty array if the user has no new messages or an array
1512 containing links and revisions if there are new messages (See
1513 User::getNewMessageLinks)
1514 $user: The user object of the user who is loading the page
1515 $out: OutputPage object (to check what type of page the user is on)
1516
1517 'GetPreferences': Modify user preferences.
1518 $user: User whose preferences are being modified.
1519 &$preferences: Preferences description array, to be fed to an HTMLForm object
1520
1521 'GetRelativeTimestamp': Pre-emptively override the relative timestamp generated
1522 by MWTimestamp::getRelativeTimestamp(). Return false in this hook to use the
1523 custom output.
1524 &$output: string for the output timestamp
1525 &$diff: DateInterval representing the difference between the timestamps
1526 $timestamp: MWTimestamp object of the current (user-adjusted) timestamp
1527 $relativeTo: MWTimestamp object of the relative (user-adjusted) timestamp
1528 $user: User whose preferences are being used to make timestamp
1529 $lang: Language that will be used to render the timestamp
1530
1531 'getUserPermissionsErrors': Add a permissions error when permissions errors are
1532 checked for. Use instead of userCan for most cases. Return false if the user
1533 can't do it, and populate $result with the reason in the form of
1534 array( messagename, param1, param2, ... ) or a MessageSpecifier instance (you
1535 might want to use ApiMessage to provide machine-readable details for the API).
1536 For consistency, error messages
1537 should be plain text with no special coloring, bolding, etc. to show that
1538 they're errors; presenting them properly to the user as errors is done by the
1539 caller.
1540 &$title: Title object being checked against
1541 &$user: Current user object
1542 $action: Action being checked
1543 &$result: User permissions error to add. If none, return true.
1544
1545 'getUserPermissionsErrorsExpensive': Equal to getUserPermissionsErrors, but is
1546 called only if expensive checks are enabled. Add a permissions error when
1547 permissions errors are checked for. Return false if the user can't do it, and
1548 populate $result with the reason in the form of array( messagename, param1,
1549 param2, ... ) or a MessageSpecifier instance (you might want to use ApiMessage
1550 to provide machine-readable details for the API). For consistency, error
1551 messages should be plain text with no
1552 special coloring, bolding, etc. to show that they're errors; presenting them
1553 properly to the user as errors is done by the caller.
1554 &$title: Title object being checked against
1555 &$user: Current user object
1556 $action: Action being checked
1557 &$result: User permissions error to add. If none, return true.
1558
1559 'GitViewers': Called when generating the list of git viewers for
1560 Special:Version, use this to change the list.
1561 &$extTypes: associative array of repo URLS to viewer URLs.
1562
1563 'HistoryRevisionTools': Override or extend the revision tools available from the
1564 page history view, i.e. undo, rollback, etc.
1565 $rev: Revision object
1566 &$links: Array of HTML links
1567 $prevRev: Revision object, next in line in page history, or null
1568 $user: Current user object
1569
1570 'HTMLFileCache::useFileCache': Override whether a page should be cached in file
1571 cache.
1572 $context: An IContextSource object with information about the request being
1573 served.
1574
1575 'ImageBeforeProduceHTML': Called before producing the HTML created by a wiki
1576 image insertion. You can skip the default logic entirely by returning false, or
1577 just modify a few things using call-by-reference.
1578 &$skin: Skin object
1579 &$title: Title object of the image
1580 &$file: File object, or false if it doesn't exist
1581 &$frameParams: Various parameters with special meanings; see documentation in
1582 includes/Linker.php for Linker::makeImageLink
1583 &$handlerParams: Various parameters with special meanings; see documentation in
1584 includes/Linker.php for Linker::makeImageLink
1585 &$time: Timestamp of file in 'YYYYMMDDHHIISS' string form, or false for current
1586 &$res: Final HTML output, used if you return false
1587
1588 'ImageOpenShowImageInlineBefore': Call potential extension just before showing
1589 the image on an image page.
1590 &$imagePage: ImagePage object ($this)
1591 &$output: $wgOut
1592
1593 'ImagePageAfterImageLinks': Called after the image links section on an image
1594 page is built.
1595 $imagePage: ImagePage object ($this)
1596 &$html: HTML for the hook to add
1597
1598 'ImagePageFileHistoryLine': Called when a file history line is constructed.
1599 $imagePage: ImagePage object ($this)
1600 $file: the file
1601 &$line: the HTML of the history line
1602 &$css: the line CSS class
1603
1604 'ImagePageFindFile': Called when fetching the file associated with an image
1605 page.
1606 $page: ImagePage object
1607 &$file: File object
1608 &$displayFile: displayed File object
1609
1610 'ImagePageShowTOC': Called when the file toc on an image page is generated.
1611 $page: ImagePage object
1612 &$toc: Array of <li> strings
1613
1614 'ImgAuthBeforeStream': executed before file is streamed to user, but only when
1615 using img_auth.php.
1616 &$title: the Title object of the file as it would appear for the upload page
1617 &$path: the original file and path name when img_auth was invoked by the web
1618 server
1619 &$name: the name only component of the file
1620 &$result: The location to pass back results of the hook routine (only used if
1621 failed)
1622 $result[0]=The index of the header message
1623 $result[1]=The index of the body text message
1624 $result[2 through n]=Parameters passed to body text message. Please note the
1625 header message cannot receive/use parameters.
1626
1627 'ImportHandleLogItemXMLTag': When parsing a XML tag in a log item.
1628 Return false to stop further processing of the tag
1629 $reader: XMLReader object
1630 $logInfo: Array of information
1631
1632 'ImportHandlePageXMLTag': When parsing a XML tag in a page.
1633 Return false to stop further processing of the tag
1634 $reader: XMLReader object
1635 &$pageInfo: Array of information
1636
1637 'ImportHandleRevisionXMLTag': When parsing a XML tag in a page revision.
1638 Return false to stop further processing of the tag
1639 $reader: XMLReader object
1640 $pageInfo: Array of page information
1641 $revisionInfo: Array of revision information
1642
1643 'ImportHandleToplevelXMLTag': When parsing a top level XML tag.
1644 Return false to stop further processing of the tag
1645 $reader: XMLReader object
1646
1647 'ImportHandleUploadXMLTag': When parsing a XML tag in a file upload.
1648 Return false to stop further processing of the tag
1649 $reader: XMLReader object
1650 $revisionInfo: Array of information
1651
1652 'ImportLogInterwikiLink': Hook to change the interwiki link used in log entries
1653 and edit summaries for transwiki imports.
1654 &$fullInterwikiPrefix: Interwiki prefix, may contain colons.
1655 &$pageTitle: String that contains page title.
1656
1657 'ImportSources': Called when reading from the $wgImportSources configuration
1658 variable. Can be used to lazy-load the import sources list.
1659 &$importSources: The value of $wgImportSources. Modify as necessary. See the
1660 comment in DefaultSettings.php for the detail of how to structure this array.
1661
1662 'InfoAction': When building information to display on the action=info page.
1663 $context: IContextSource object
1664 &$pageInfo: Array of information
1665
1666 'InitializeArticleMaybeRedirect': MediaWiki check to see if title is a redirect.
1667 &$title: Title object for the current page
1668 &$request: WebRequest
1669 &$ignoreRedirect: boolean to skip redirect check
1670 &$target: Title/string of redirect target
1671 &$article: Article object
1672
1673 'InternalParseBeforeLinks': during Parser's internalParse method before links
1674 but after nowiki/noinclude/includeonly/onlyinclude and other processings.
1675 &$parser: Parser object
1676 &$text: string containing partially parsed text
1677 &$stripState: Parser's internal StripState object
1678
1679 'InternalParseBeforeSanitize': during Parser's internalParse method just before
1680 the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/
1681 includeonly/onlyinclude and other processings. Ideal for syntax-extensions after
1682 template/parser function execution which respect nowiki and HTML-comments.
1683 &$parser: Parser object
1684 &$text: string containing partially parsed text
1685 &$stripState: Parser's internal StripState object
1686
1687 'InterwikiLoadPrefix': When resolving if a given prefix is an interwiki or not.
1688 Return true without providing an interwiki to continue interwiki search.
1689 $prefix: interwiki prefix we are looking for.
1690 &$iwData: output array describing the interwiki with keys iw_url, iw_local,
1691 iw_trans and optionally iw_api and iw_wikiid.
1692
1693 'InvalidateEmailComplete': Called after a user's email has been invalidated
1694 successfully.
1695 $user: user (object) whose email is being invalidated
1696
1697 'IRCLineURL': When constructing the URL to use in an IRC notification.
1698 Callee may modify $url and $query, URL will be constructed as $url . $query
1699 &$url: URL to index.php
1700 &$query: Query string
1701 $rc: RecentChange object that triggered url generation
1702
1703 'IsFileCacheable': Override the result of Article::isFileCacheable() (if true)
1704 &$article: article (object) being checked
1705
1706 'IsTrustedProxy': Override the result of IP::isTrustedProxy()
1707 &$ip: IP being check
1708 &$result: Change this value to override the result of IP::isTrustedProxy()
1709
1710 'IsUploadAllowedFromUrl': Override the result of UploadFromUrl::isAllowedUrl()
1711 $url: URL used to upload from
1712 &$allowed: Boolean indicating if uploading is allowed for given URL
1713
1714 'isValidEmailAddr': Override the result of Sanitizer::validateEmail(), for
1715 instance to return false if the domain name doesn't match your organization.
1716 $addr: The e-mail address entered by the user
1717 &$result: Set this and return false to override the internal checks
1718
1719 'isValidPassword': Override the result of User::isValidPassword()
1720 $password: The password entered by the user
1721 &$result: Set this and return false to override the internal checks
1722 $user: User the password is being validated for
1723
1724 'Language::getMessagesFileName':
1725 $code: The language code or the language we're looking for a messages file for
1726 &$file: The messages file path, you can override this to change the location.
1727
1728 'LanguageGetMagic': DEPRECATED! Use $magicWords in a file listed in
1729 $wgExtensionMessagesFiles instead.
1730 Use this to define synonyms of magic words depending of the language
1731 &$magicExtensions: associative array of magic words synonyms
1732 $lang: language code (string)
1733
1734 'LanguageGetNamespaces': Provide custom ordering for namespaces or
1735 remove namespaces. Do not use this hook to add namespaces. Use
1736 CanonicalNamespaces for that.
1737 &$namespaces: Array of namespaces indexed by their numbers
1738
1739 'LanguageGetSpecialPageAliases': DEPRECATED! Use $specialPageAliases in a file
1740 listed in $wgExtensionMessagesFiles instead.
1741 Use to define aliases of special pages names depending of the language
1742 &$specialPageAliases: associative array of magic words synonyms
1743 $lang: language code (string)
1744
1745 'LanguageGetTranslatedLanguageNames': Provide translated language names.
1746 &$names: array of language code => language name
1747 $code: language of the preferred translations
1748
1749 'LanguageLinks': Manipulate a page's language links. This is called
1750 in various places to allow extensions to define the effective language
1751 links for a page.
1752 $title: The page's Title.
1753 &$links: Associative array mapping language codes to prefixed links of the
1754 form "language:title".
1755 &$linkFlags: Associative array mapping prefixed links to arrays of flags.
1756 Currently unused, but planned to provide support for marking individual
1757 language links in the UI, e.g. for featured articles.
1758
1759 'LanguageSelector': Hook to change the language selector available on a page.
1760 $out: The output page.
1761 $cssClassName: CSS class name of the language selector.
1762
1763 'LinkBegin': Used when generating internal and interwiki links in
1764 Linker::link(), before processing starts. Return false to skip default
1765 processing and return $ret. See documentation for Linker::link() for details on
1766 the expected meanings of parameters.
1767 $skin: the Skin object
1768 $target: the Title that the link is pointing to
1769 &$html: the contents that the <a> tag should have (raw HTML); null means
1770 "default".
1771 &$customAttribs: the HTML attributes that the <a> tag should have, in
1772 associative array form, with keys and values unescaped. Should be merged
1773 with default values, with a value of false meaning to suppress the
1774 attribute.
1775 &$query: the query string to add to the generated URL (the bit after the "?"),
1776 in associative array form, with keys and values unescaped.
1777 &$options: array of options. Can include 'known', 'broken', 'noclasses'.
1778 &$ret: the value to return if your hook returns false.
1779
1780 'LinkEnd': Used when generating internal and interwiki links in Linker::link(),
1781 just before the function returns a value. If you return true, an <a> element
1782 with HTML attributes $attribs and contents $html will be returned. If you
1783 return false, $ret will be returned.
1784 $skin: the Skin object
1785 $target: the Title object that the link is pointing to
1786 $options: the options. Will always include either 'known' or 'broken', and may
1787 include 'noclasses'.
1788 &$html: the final (raw HTML) contents of the <a> tag, after processing.
1789 &$attribs: the final HTML attributes of the <a> tag, after processing, in
1790 associative array form.
1791 &$ret: the value to return if your hook returns false.
1792
1793 'LinkerMakeExternalImage': At the end of Linker::makeExternalImage() just
1794 before the return.
1795 &$url: the image url
1796 &$alt: the image's alt text
1797 &$img: the new image HTML (if returning false)
1798
1799 'LinkerMakeExternalLink': At the end of Linker::makeExternalLink() just
1800 before the return.
1801 &$url: the link url
1802 &$text: the link text
1803 &$link: the new link HTML (if returning false)
1804 &$attribs: the attributes to be applied.
1805 $linkType: The external link type
1806
1807 'LinkerMakeMediaLinkFile': At the end of Linker::makeMediaLinkFile() just
1808 before the return.
1809 $title: the Title object that the link is pointing to
1810 $file: the File object or false if broken link
1811 &$html: the link text
1812 &$attribs: the attributes to be applied
1813 &$ret: the value to return if your hook returns false
1814
1815 'LinksUpdate': At the beginning of LinksUpdate::doUpdate() just before the
1816 actual update.
1817 &$linksUpdate: the LinksUpdate object
1818
1819 'LinksUpdateAfterInsert': At the end of LinksUpdate::incrTableUpdate() after
1820 each link table insert. For example, pagelinks, imagelinks, externallinks.
1821 $linksUpdate: LinksUpdate object
1822 $table: the table to insert links to
1823 $insertions: an array of links to insert
1824
1825 'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating,
1826 including delete and insert, has completed for all link tables
1827 &$linksUpdate: the LinksUpdate object
1828
1829 'LinksUpdateConstructed': At the end of LinksUpdate() is construction.
1830 &$linksUpdate: the LinksUpdate object
1831
1832 'ListDefinedTags': When trying to find all defined tags.
1833 &$tags: The list of tags.
1834
1835 'LoadExtensionSchemaUpdates': Called during database installation and updates.
1836 $updater: A DatabaseUpdater subclass
1837
1838 'LocalFile::getHistory': Called before file history query performed.
1839 &$file: the File object
1840 &$tables: tables
1841 &$fields: select fields
1842 &$conds: conditions
1843 &$opts: query options
1844 &$join_conds: JOIN conditions
1845
1846 'LocalFilePurgeThumbnails': Called before thumbnails for a local file a purged.
1847 $file: the File object
1848 $archiveName: name of an old file version or false if it's the current one
1849
1850 'LocalisationCacheRecache': Called when loading the localisation data into
1851 cache.
1852 $cache: The LocalisationCache object
1853 $code: language code
1854 &$alldata: The localisation data from core and extensions
1855 &$purgeBlobs: whether to purge/update the message blobs via
1856 MessageBlobStore::clear()
1857
1858 'LocalisationCacheRecacheFallback': Called for each language when merging
1859 fallback data into the cache.
1860 $cache: The LocalisationCache object
1861 $code: language code
1862 &$alldata: The localisation data from core and extensions. Note some keys may
1863 be omitted if they won't be merged into the final result.
1864
1865 'LocalisationChecksBlacklist': When fetching the blacklist of
1866 localisation checks.
1867 &$blacklist: array of checks to blacklist. See the bottom of
1868 maintenance/language/checkLanguage.inc for the format of this variable.
1869
1870 'LocalisationIgnoredOptionalMessages': When fetching the list of ignored and
1871 optional localisation messages
1872 &$ignored: Array of ignored message keys
1873 &$optional: Array of optional message keys
1874
1875 'LocalUserCreated': Called when a local user has been created
1876 $user: User object for the created user
1877 $autocreated: Boolean, whether this was an auto-creation
1878
1879 'LogEventsListGetExtraInputs': When getting extra inputs to display on
1880 Special:Log for a specific log type
1881 $type: String of log type being displayed
1882 $logEventsList: LogEventsList object for context and access to the WebRequest
1883 &$input: string HTML of an input element
1884
1885 'LogEventsListShowLogExtract': Called before the string is added to OutputPage.
1886 Returning false will prevent the string from being added to the OutputPage.
1887 &$s: html string to show for the log extract
1888 $types: String or Array Log types to show
1889 $page: String or Title The page title to show log entries for
1890 $user: String The user who made the log entries
1891 $param: Associative Array with the following additional options:
1892 - lim Integer Limit of items to show, default is 50
1893 - conds Array Extra conditions for the query (e.g. "log_action != 'revision'")
1894 - showIfEmpty boolean Set to false if you don't want any output in case the
1895 loglist is empty if set to true (default), "No matching items in log" is
1896 displayed if loglist is empty
1897 - msgKey Array If you want a nice box with a message, set this to the key of
1898 the message. First element is the message key, additional optional elements
1899 are parameters for the key that are processed with
1900 wfMessage()->params()->parseAsBlock()
1901 - offset Set to overwrite offset parameter in $wgRequest set to '' to unset
1902 offset
1903 - wrap String Wrap the message in html (usually something like
1904 "&lt;div ...>$1&lt;/div>").
1905 - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
1906
1907 'LogException': Called before an exception (or PHP error) is logged. This is
1908 meant for integration with external error aggregation services; returning false
1909 will NOT prevent logging.
1910 $e: The exception (in case of a plain old PHP error, a wrapping ErrorException)
1911 $suppressed: true if the error was suppressed via
1912 error_reporting()/wfSuppressWarnings()
1913
1914 'LoginAuthenticateAudit': A login attempt for a valid user account either
1915 succeeded or failed. No return data is accepted; this hook is for auditing only.
1916 $user: the User object being authenticated against
1917 $password: the password being submitted and found wanting
1918 $retval: a LoginForm class constant with authenticateUserData() return
1919 value (SUCCESS, WRONG_PASS, etc.).
1920
1921 'LoginFormValidErrorMessages': Called in LoginForm when a function gets valid
1922 error messages. Allows to add additional error messages (except messages already
1923 in LoginForm::$validErrorMessages).
1924 &$messages: Already added messages (inclusive messages from
1925 LoginForm::$validErrorMessages)
1926
1927 'LoginPasswordResetMessage': User is being requested to reset their password on
1928 login. Use this hook to change the Message that will be output on
1929 Special:ChangePassword.
1930 &$msg: Message object that will be shown to the user
1931 $username: Username of the user who's password was expired.
1932
1933 'LoginUserMigrated': Called during login to allow extensions the opportunity to
1934 inform a user that their username doesn't exist for a specific reason, instead
1935 of letting the login form give the generic error message that the account does
1936 not exist. For example, when the account has been renamed or deleted.
1937 $user: the User object being authenticated against.
1938 &$msg: the message identifier for abort reason, or an array to pass a message
1939 key and parameters.
1940
1941 'LogLine': Processes a single log entry on Special:Log.
1942 $log_type: string for the type of log entry (e.g. 'move'). Corresponds to
1943 logging.log_type database field.
1944 $log_action: string for the type of log action (e.g. 'delete', 'block',
1945 'create2'). Corresponds to logging.log_action database field.
1946 $title: Title object that corresponds to logging.log_namespace and
1947 logging.log_title database fields.
1948 $paramArray: Array of parameters that corresponds to logging.log_params field.
1949 Note that only $paramArray[0] appears to contain anything.
1950 &$comment: string that corresponds to logging.log_comment database field, and
1951 which is displayed in the UI.
1952 &$revert: string that is displayed in the UI, similar to $comment.
1953 $time: timestamp of the log entry (added in 1.12)
1954
1955 'LonelyPagesQuery': Allow extensions to modify the query used by
1956 Special:LonelyPages.
1957 &$tables: tables to join in the query
1958 &$conds: conditions for the query
1959 &$joinConds: join conditions for the query
1960
1961 'MagicWordwgVariableIDs': When defining new magic words IDs.
1962 &$variableIDs: array of strings
1963
1964 'MaintenanceRefreshLinksInit': before executing the refreshLinks.php maintenance
1965 script.
1966 $refreshLinks: RefreshLinks object
1967
1968 'MakeGlobalVariablesScript': Called at end of OutputPage::getJSVars.
1969 Ideally, this hook should only be used to add variables that depend on
1970 the current page/request; static configuration should be added through
1971 ResourceLoaderGetConfigVars instead.
1972 &$vars: variable (or multiple variables) to be added into the output of
1973 Skin::makeVariablesScript
1974 $out: The OutputPage which called the hook, can be used to get the real title.
1975
1976 'MarkPatrolled': Before an edit is marked patrolled.
1977 $rcid: ID of the revision to be marked patrolled
1978 &$user: the user (object) marking the revision as patrolled
1979 $wcOnlySysopsCanPatrol: config setting indicating whether the user needs to be a
1980 sysop in order to mark an edit patrolled.
1981 $auto: true if the edit is being marked as patrolled automatically
1982
1983 'MarkPatrolledComplete': After an edit is marked patrolled.
1984 $rcid: ID of the revision marked as patrolled
1985 &$user: user (object) who marked the edit patrolled
1986 $wcOnlySysopsCanPatrol: config setting indicating whether the user must be a
1987 sysop to patrol the edit.
1988 $auto: true if the edit is being marked as patrolled automatically
1989
1990 'MediaWikiPerformAction': Override MediaWiki::performAction(). Use this to do
1991 something completely different, after the basic globals have been set up, but
1992 before ordinary actions take place.
1993 $output: $wgOut
1994 $article: Article on which the action will be performed
1995 $title: Title on which the action will be performed
1996 $user: $wgUser
1997 $request: $wgRequest
1998 $mediaWiki: The $mediawiki object
1999
2000 'MessageCache::get': When fetching a message. Can be used to override the key
2001 for customisations. Given and returned message key must be in special format:
2002 1) first letter must be in lower case according to the content language.
2003 2) spaces must be replaced with underscores
2004 &$key: message key (string)
2005
2006 'MessageCacheReplace': When a message page is changed. Useful for updating
2007 caches.
2008 $title: name of the page changed.
2009 $text: new contents of the page.
2010
2011 'MessagesPreLoad': When loading a message from the database.
2012 $title: title of the message (string)
2013 &$message: value (string), change it to the message you want to define
2014
2015 'MimeMagicGuessFromContent': Allows MW extensions guess the MIME by content.
2016 $mimeMagic: Instance of MimeMagic.
2017 &$head: First 1024 bytes of the file in a string (in - Do not alter!).
2018 &$tail: More or equal than last 65558 bytes of the file in a string
2019 (in - Do not alter!).
2020 $file: File path.
2021 &$mime: MIME type (out).
2022
2023 'MimeMagicImproveFromExtension': Allows MW extensions to further improve the
2024 MIME type detected by considering the file extension.
2025 $mimeMagic: Instance of MimeMagic.
2026 $ext: File extension.
2027 &$mime: MIME type (in/out).
2028
2029 'MimeMagicInit': Before processing the list mapping MIME types to media types
2030 and the list mapping MIME types to file extensions.
2031 As an extension author, you are encouraged to submit patches to MediaWiki's
2032 core to add new MIME types to mime.types.
2033 $mimeMagic: Instance of MimeMagic.
2034 Use $mimeMagic->addExtraInfo( $stringOfInfo );
2035 for adding new MIME info to the list.
2036 Use $mimeMagic->addExtraTypes( $stringOfTypes );
2037 for adding new MIME types to the list.
2038
2039 'ModifyExportQuery': Modify the query used by the exporter.
2040 $db: The database object to be queried.
2041 &$tables: Tables in the query.
2042 &$conds: Conditions in the query.
2043 &$opts: Options for the query.
2044 &$join_conds: Join conditions for the query.
2045
2046 'MovePageCheckPermissions': Specify whether the user is allowed to move the
2047 page.
2048 $oldTitle: Title object of the current (old) location
2049 $newTitle: Title object of the new location
2050 $user: User making the move
2051 $reason: string of the reason provided by the user
2052 $status: Status object to pass error messages to
2053
2054 'MovePageIsValidMove': Specify whether a page can be moved for technical
2055 reasons.
2056 $oldTitle: Title object of the current (old) location
2057 $newTitle: Title object of the new location
2058 $status: Status object to pass error messages to
2059
2060 'NamespaceIsMovable': Called when determining if it is possible to pages in a
2061 namespace.
2062 $index: Integer; the index of the namespace being checked.
2063 &$result: Boolean; whether MediaWiki currently thinks that pages in this
2064 namespace are movable. Hooks may change this value to override the return
2065 value of MWNamespace::isMovable().
2066
2067 'NewDifferenceEngine': Called when a new DifferenceEngine object is made
2068 $title: the diff page title (nullable)
2069 &$oldId: the actual old Id to use in the diff
2070 &$newId: the actual new Id to use in the diff (0 means current)
2071 $old: the ?old= param value from the url
2072 $new: the ?new= param value from the url
2073
2074 'NewRevisionFromEditComplete': Called when a revision was inserted due to an
2075 edit.
2076 $wikiPage: the WikiPage edited
2077 $rev: the new revision
2078 $baseID: the revision ID this was based off, if any
2079 $user: the editing user
2080
2081 'OldChangesListRecentChangesLine': Customize entire recent changes line, or
2082 return false to omit the line from RecentChanges and Watchlist special pages.
2083 &$changeslist: The OldChangesList instance.
2084 &$s: HTML of the form "<li>...</li>" containing one RC entry.
2085 $rc: The RecentChange object.
2086 &$classes: array of css classes for the <li> element
2087
2088 'OpenSearchUrls': Called when constructing the OpenSearch description XML. Hooks
2089 can alter or append to the array of URLs for search & suggestion formats.
2090 &$urls: array of associative arrays with Url element attributes
2091
2092 'OpportunisticLinksUpdate': Called by WikiPage::triggerOpportunisticLinksUpdate
2093 when a page view triggers a re-rendering of the page. This may happen
2094 particularly if the parser cache is split by user language, and no cached
2095 rendering of the page exists in the user's language. The hook is called
2096 before checking whether page_links_updated indicates that the links are up
2097 to date. Returning false will cause triggerOpportunisticLinksUpdate() to abort
2098 without triggering any updates.
2099 $page: the Page that was rendered.
2100 $title: the Title of the rendered page.
2101 $parserOutput: ParserOutput resulting from rendering the page.
2102
2103 'OtherBlockLogLink': Get links to the block log from extensions which blocks
2104 users and/or IP addresses too.
2105 &$otherBlockLink: An array with links to other block logs
2106 $ip: The requested IP address or username
2107
2108 'OutputPageBeforeHTML': A page has been processed by the parser and the
2109 resulting HTML is about to be displayed.
2110 &$parserOutput: the parserOutput (object) that corresponds to the page
2111 &$text: the text that will be displayed, in HTML (string)
2112
2113 'OutputPageBodyAttributes': Called when OutputPage::headElement is creating the
2114 body tag to allow for extensions to add attributes to the body of the page they
2115 might need. Or to allow building extensions to add body classes that aren't of
2116 high enough demand to be included in core.
2117 $out: The OutputPage which called the hook, can be used to get the real title
2118 $sk: The Skin that called OutputPage::headElement
2119 &$bodyAttrs: An array of attributes for the body tag passed to Html::openElement
2120
2121 'OutputPageCheckLastModified': when checking if the page has been modified
2122 since the last visit.
2123 &$modifiedTimes: array of timestamps.
2124 The following keys are set: page, user, epoch
2125
2126 'OutputPageMakeCategoryLinks': Links are about to be generated for the page's
2127 categories. Implementations should return false if they generate the category
2128 links, so the default link generation is skipped.
2129 &$out: OutputPage instance (object)
2130 $categories: associative array, keys are category names, values are category
2131 types ("normal" or "hidden")
2132 &$links: array, intended to hold the result. Must be an associative array with
2133 category types as keys and arrays of HTML links as values.
2134
2135 'OutputPageParserOutput': after adding a parserOutput to $wgOut
2136 &$out: OutputPage instance (object)
2137 $parserOutput: parserOutput instance being added in $out
2138
2139 'PageContentInsertComplete': After a new article is created.
2140 $wikiPage: WikiPage created
2141 $user: User creating the article
2142 $content: New content as a Content object
2143 $summary: Edit summary/comment
2144 $isMinor: Whether or not the edit was marked as minor
2145 $isWatch: (No longer used)
2146 $section: (No longer used)
2147 $flags: Flags passed to WikiPage::doEditContent()
2148 $revision: New Revision of the article
2149
2150 'PageContentLanguage': Allows changing the language in which the content of a
2151 page is written. Defaults to the wiki content language ($wgContLang).
2152 $title: Title object
2153 &$pageLang: the page content language (either an object or a language code)
2154 $wgLang: the user language
2155
2156 'PageContentSave': Before an article is saved.
2157 $wikiPage: the WikiPage (object) being saved
2158 $user: the user (object) saving the article
2159 $content: the new article content, as a Content object
2160 $summary: the article summary (comment)
2161 $isminor: minor flag
2162 $iswatch: watch flag
2163 $section: section #
2164
2165 'PageContentSaveComplete': After an article has been updated.
2166 $wikiPage: WikiPage modified
2167 $user: User performing the modification
2168 $content: New content, as a Content object
2169 $summary: Edit summary/comment
2170 $isMinor: Whether or not the edit was marked as minor
2171 $isWatch: (No longer used)
2172 $section: (No longer used)
2173 $flags: Flags passed to WikiPage::doEditContent()
2174 $revision: New Revision of the article (can be null for edits that change
2175 nothing)
2176 $status: Status object about to be returned by doEditContent()
2177 $baseRevId: the rev ID (or false) this edit was based on
2178
2179 'PageHistoryBeforeList': When a history page list is about to be constructed.
2180 &$article: the article that the history is loading for
2181 $context: RequestContext object
2182
2183 'PageHistoryLineEnding': Right before the end <li> is added to a history line.
2184 $historyAction: the action object
2185 &$row: the revision row for this line
2186 &$s: the string representing this parsed line
2187 &$classes: array containing the <li> element classes
2188
2189 'PageHistoryPager::doBatchLookups': Called after the pager query was run, before
2190 any output is generated, to allow batch lookups for prefetching information
2191 needed for display. If the hook handler returns false, the regular behavior of
2192 doBatchLookups() is skipped.
2193 $pager: the PageHistoryPager
2194 $result: a ResultWrapper representing the query result
2195
2196 'PageHistoryPager::getQueryInfo': when a history pager query parameter set is
2197 constructed.
2198 &$pager: the pager
2199 &$queryInfo: the query parameters
2200
2201 'PageRenderingHash': Alter the parser cache option hash key. A parser extension
2202 which depends on user options should install this hook and append its values to
2203 the key.
2204 &$confstr: reference to a hash key string which can be modified
2205 $user: User (object) requesting the page
2206 &$forOptions: array of options the hash is for
2207
2208 'PageViewUpdates': Allow database (or other) changes to be made after a
2209 page view is seen by MediaWiki. Note this does not capture views made
2210 via external caches such as Squid.
2211 $wikipage: WikiPage (object) for the page being viewed.
2212 $user: User (object) for the user who is viewing.
2213
2214 'ParserAfterParse': Called from Parser::parse() just after the call to
2215 Parser::internalParse() returns.
2216 &$parser: parser object
2217 &$text: text being parsed
2218 &$stripState: stripState used (object)
2219
2220 'ParserAfterStrip': Called at end of parsing time.
2221 TODO: No more strip, deprecated ?
2222 &$parser: parser object
2223 &$text: text being parsed
2224 &$stripState: stripState used (object)
2225
2226 'ParserAfterTidy': Called after Parser::tidy() in Parser::parse()
2227 &$parser: Parser object being used
2228 &$text: text that will be returned
2229
2230 'ParserAfterUnstrip': Called after the first unstripGeneral() in
2231 Parser::internalParseHalfParsed()
2232 &$parser: Parser object being used
2233 &$text: text that will be returned
2234
2235 'ParserBeforeInternalParse': Called at the beginning of Parser::internalParse().
2236 &$parser: Parser object
2237 &$text: text to parse
2238 &$stripState: StripState instance being used
2239
2240 'ParserBeforeStrip': Called at start of parsing time.
2241 TODO: No more strip, deprecated ?
2242 &$parser: parser object
2243 &$text: text being parsed
2244 &$stripState: stripState used (object)
2245
2246 'ParserBeforeTidy': Called before tidy and custom tags replacements.
2247 &$parser: Parser object being used
2248 &$text: actual text
2249
2250 'ParserCacheSaveComplete': Called after a ParserOutput has been committed to
2251 the parser cache.
2252 $parserCache: ParserCache object $parserOutput was stored in
2253 $parserOutput: ParserOutput object that was stored
2254 $title: Title of the page that was parsed to generate $parserOutput
2255 $popts: ParserOptions used for generating $parserOutput
2256 $revId: ID of the revision that was parsed to create $parserOutput
2257
2258 'ParserClearState': Called at the end of Parser::clearState().
2259 &$parser: Parser object being cleared
2260
2261 'ParserCloned': Called when the parser is cloned.
2262 $parser: Newly-cloned Parser object
2263
2264 'ParserFirstCallInit': Called when the parser initialises for the first time.
2265 &$parser: Parser object being cleared
2266
2267 'ParserGetVariableValueSwitch': Called when the parser need the value of a
2268 custom magic word
2269 &$parser: Parser object
2270 &$varCache: array to store the value in case of multiples calls of the
2271 same magic word
2272 &$index: index (string) of the magic
2273 &$ret: value of the magic word (the hook should set it)
2274 &$frame: PPFrame object to use for expanding any template variables
2275
2276 'ParserGetVariableValueTs': Use this to change the value of the time for the
2277 {{LOCAL...}} magic word.
2278 &$parser: Parser object
2279 &$time: actual time (timestamp)
2280
2281 'ParserGetVariableValueVarCache': use this to change the value of the variable
2282 cache or return false to not use it.
2283 &$parser: Parser object
2284 &$varCache: variable cache (array)
2285
2286 'ParserLimitReport': DEPRECATED! Use ParserLimitReportPrepare and
2287 ParserLimitReportFormat instead.
2288 Called at the end of Parser:parse() when the parser will
2289 include comments about size of the text parsed.
2290 $parser: Parser object
2291 &$limitReport: text that will be included (without comment tags)
2292
2293 'ParserLimitReportFormat': Called for each row in the parser limit report that
2294 needs formatting. If nothing handles this hook, the default is to use "$key" to
2295 get the label, and "$key-value" or "$key-value-text"/"$key-value-html" to
2296 format the value.
2297 $key: Key for the limit report item (string)
2298 &$value: Value of the limit report item
2299 &$report: String onto which to append the data
2300 $isHTML: If true, $report is an HTML table with two columns; if false, it's
2301 text intended for display in a monospaced font.
2302 $localize: If false, $report should be output in English.
2303
2304 'ParserLimitReportPrepare': Called at the end of Parser:parse() when the parser
2305 will include comments about size of the text parsed. Hooks should use
2306 $output->setLimitReportData() to populate data. Functions for this hook should
2307 not use $wgLang; do that in ParserLimitReportFormat instead.
2308 $parser: Parser object
2309 $output: ParserOutput object
2310
2311 'ParserMakeImageParams': Called before the parser make an image link, use this
2312 to modify the parameters of the image.
2313 $title: title object representing the file
2314 $file: file object that will be used to create the image
2315 &$params: 2-D array of parameters
2316 $parser: Parser object that called the hook
2317
2318 'ParserSectionCreate': Called each time the parser creates a document section
2319 from wikitext. Use this to apply per-section modifications to HTML (like
2320 wrapping the section in a DIV). Caveat: DIVs are valid wikitext, and a DIV
2321 can begin in one section and end in another. Make sure your code can handle
2322 that case gracefully. See the EditSectionClearerLink extension for an example.
2323 $parser: the calling Parser instance
2324 $section: the section number, zero-based, but section 0 is usually empty
2325 &$sectionContent: ref to the content of the section. modify this.
2326 $showEditLinks: boolean describing whether this section has an edit link
2327
2328 'ParserTestGlobals': Allows to define globals for parser tests.
2329 &$globals: Array with all the globals which should be set for parser tests.
2330 The arrays keys serve as the globals names, its values are the globals values.
2331
2332 'ParserTestParser': Called when creating a new instance of Parser in
2333 tests/parser/parserTest.inc.
2334 &$parser: Parser object created
2335
2336 'ParserTestTables': Alter the list of tables to duplicate when parser tests are
2337 run. Use when page save hooks require the presence of custom tables to ensure
2338 that tests continue to run properly.
2339 &$tables: array of table names
2340
2341 'ParserOutputStashForEdit': Called when an edit stash parse finishes, before the output is cached.
2342 $page: the WikiPage of the candidate edit
2343 $content: the Content object of the candidate edit
2344 $output: the ParserOutput result of the candidate edit
2345
2346 'PasswordPoliciesForUser': Alter the effective password policy for a user.
2347 $user: User object whose policy you are modifying
2348 &$effectivePolicy: Array of policy statements that apply to this user
2349 $purpose: string indicating purpose of the check, one of 'login', 'create',
2350 or 'reset'
2351
2352 'PerformRetroactiveAutoblock': Called before a retroactive autoblock is applied
2353 to a user.
2354 $block: Block object (which is set to be autoblocking)
2355 &$blockIds: Array of block IDs of the autoblock
2356
2357 'PersonalUrls': Alter the user-specific navigation links (e.g. "my page,
2358 my talk page, my contributions" etc).
2359 &$personal_urls: Array of link specifiers (see SkinTemplate.php)
2360 &$title: Title object representing the current page
2361 $skin: SkinTemplate object providing context (e.g. to check if the user is
2362 logged in, etc.)
2363
2364 'PingLimiter': Allows extensions to override the results of User::pingLimiter().
2365 &$user: User performing the action
2366 $action: Action being performed
2367 &$result: Whether or not the action should be prevented
2368 Change $result and return false to give a definitive answer, otherwise
2369 the built-in rate limiting checks are used, if enabled.
2370 $incrBy: Amount to increment counter by
2371
2372 'PlaceNewSection': Override placement of new sections. Return false and put the
2373 merged text into $text to override the default behavior.
2374 $wikipage: WikiPage object
2375 $oldtext: the text of the article before editing
2376 $subject: subject of the new section
2377 &$text: text of the new section
2378
2379 'PostLoginRedirect': Modify the post login redirect behavior.
2380 Occurs after signing up or logging in, allows for interception of redirect.
2381 &$returnTo: The page name to return to, as a string
2382 &$returnToQuery: array of url parameters, mapping parameter names to values
2383 &$type: type of login redirect as string;
2384 error: display a return to link ignoring $wgRedirectOnLogin
2385 signup: display a return to link using $wgRedirectOnLogin if needed
2386 success: display a return to link using $wgRedirectOnLogin if needed
2387 successredirect: send an HTTP redirect using $wgRedirectOnLogin if needed
2388
2389 'PreferencesFormPreSave': Override preferences being saved
2390 $formData: array of user submitted data
2391 $form: PreferencesForm object, also a ContextSource
2392 $user: User object with preferences to be saved set
2393 &$result: boolean indicating success
2394
2395 'PreferencesGetLegend': Override the text used for the <legend> of a
2396 preferences section.
2397 $form: the PreferencesForm object. This is a ContextSource as well
2398 $key: the section name
2399 &$legend: the legend text. Defaults to wfMessage( "prefs-$key" )->text() but may
2400 be overridden
2401
2402 'PrefixSearchBackend': DEPRECATED! Override SearchEngine::completionSearchBackend instead.
2403 Override the title prefix search used for OpenSearch and
2404 AJAX search suggestions. Put results into &$results outparam and return false.
2405 $ns: array of int namespace keys to search in
2406 $search: search term (not guaranteed to be conveniently normalized)
2407 $limit: maximum number of results to return
2408 &$results: out param: array of page names (strings)
2409 $offset: number of results to offset from the beginning
2410
2411 'PrefixSearchExtractNamespace': Called if core was not able to extract a
2412 namespace from the search string so that extensions can attempt it.
2413 &$namespaces: array of int namespace keys to search in (change this if you can
2414 extract namespaces)
2415 &$search: search term (replace this with term without the namespace if you can
2416 extract one)
2417
2418 'PrefsEmailAudit': Called when user changes their email address.
2419 $user: User (object) changing his email address
2420 $oldaddr: old email address (string)
2421 $newaddr: new email address (string)
2422
2423 'PrefsPasswordAudit': Called when user changes his password.
2424 $user: User (object) changing his password
2425 $newPass: new password
2426 $error: error (string) 'badretype', 'wrongpassword', 'error' or 'success'
2427
2428 'ProtectionForm::buildForm': Called after all protection type fieldsets are made
2429 in the form.
2430 $article: the title being (un)protected
2431 &$output: a string of the form HTML so far
2432
2433 'ProtectionForm::save': Called when a protection form is submitted.
2434 $article: the Page being (un)protected
2435 &$errorMsg: an html message string of an error or an array of message name and
2436 its parameters
2437 $reasonstr: a string describing the reason page protection level is altered
2438
2439 'ProtectionForm::showLogExtract': Called after the protection log extract is
2440 shown.
2441 $article: the page the form is shown for
2442 $out: OutputPage object
2443
2444 'RandomPageQuery': Lets you modify the query used by Special:Random to select
2445 random pages.
2446 &$tables: Database tables to be used in the query
2447 &$conds: Conditions to be applied in the query
2448 &$joinConds: Join conditions to be applied in the query
2449
2450 'RawPageViewBeforeOutput': Right before the text is blown out in action=raw.
2451 &$obj: RawAction object
2452 &$text: The text that's going to be the output
2453
2454 'RecentChange_save': Called at the end of RecentChange::save().
2455 &$recentChange: RecentChange object
2456
2457 'RedirectSpecialArticleRedirectParams': Lets you alter the set of parameter
2458 names such as "oldid" that are preserved when using redirecting special pages
2459 such as Special:MyPage and Special:MyTalk.
2460 &$redirectParams: An array of parameters preserved by redirecting special pages.
2461
2462 'RejectParserCacheValue': Return false to reject an otherwise usable
2463 cached value from the Parser cache. NOTE: CARELESS USE OF THIS HOOK CAN
2464 HAVE CATASTROPHIC CONSEQUENCES FOR HIGH-TRAFFIC INSTALLATIONS. USE WITH
2465 EXTREME CARE.
2466 $parserOutput: ParserOutput value.
2467 $wikiPage: WikiPage object.
2468 $parserOptions: ParserOptions object.
2469
2470 'RequestContextCreateSkin': Called when RequestContext::getSkin creates a skin
2471 instance. Can be used by an extension override what skin is used in certain
2472 contexts.
2473 $context: (IContextSource) The RequestContext the skin is being created for.
2474 &$skin: A variable reference you may set a Skin instance or string key on to
2475 override the skin that will be used for the context.
2476
2477 'ResetPasswordExpiration': Allow extensions to set a default password expiration
2478 $user: The user having their password expiration reset
2479 &$newExpire: The new expiration date
2480
2481 'ResourceLoaderForeignApiModules': Called from ResourceLoaderForeignApiModule.
2482 Use this to add dependencies to 'mediawiki.ForeignApi' module when you wish
2483 to override its behavior. See the module docs for more information.
2484 &$dependencies: string[] List of modules that 'mediawiki.ForeignApi' should
2485 depend on
2486 $context: ResourceLoaderContext|null
2487
2488 'ResourceLoaderGetConfigVars': Called at the end of
2489 ResourceLoaderStartUpModule::getConfigSettings(). Use this to export static
2490 configuration variables to JavaScript. Things that depend on the current page
2491 or request state must be added through MakeGlobalVariablesScript instead.
2492 &$vars: array( variable name => value )
2493
2494 'ResourceLoaderGetLessVars': Called in ResourceLoader::getLessVars after
2495 variables from $wgResourceLoaderLESSVars are added. Can be used to add
2496 context-based variables.
2497 &$lessVars: array of variables already added
2498
2499 'ResourceLoaderRegisterModules': Right before modules information is required,
2500 such as when responding to a resource
2501 loader request or generating HTML output.
2502 &$resourceLoader: ResourceLoader object
2503
2504 'ResourceLoaderTestModules': Let you add new JavaScript testing modules. This is
2505 called after the addition of 'qunit' and MediaWiki testing resources.
2506 &$testModules: array of JavaScript testing modules. The 'qunit' framework,
2507 included in core, is fed using tests/qunit/QUnitTestResources.php.
2508 To add a new qunit module named 'myext.tests':
2509 $testModules['qunit']['myext.tests'] = array(
2510 'script' => 'extension/myext/tests.js',
2511 'dependencies' => <any module dependency you might have>
2512 );
2513 For QUnit framework, the mediawiki.tests.qunit.testrunner dependency will be
2514 added to any module.
2515 &$ResourceLoader: object
2516
2517 'RevisionInsertComplete': Called after a revision is inserted into the database.
2518 &$revision: the Revision
2519 $data: the data stored in old_text. The meaning depends on $flags: if external
2520 is set, it's the URL of the revision text in external storage; otherwise,
2521 it's the revision text itself. In either case, if gzip is set, the revision
2522 text is gzipped.
2523 $flags: a comma-delimited list of strings representing the options used. May
2524 include: utf8 (this will always be set for new revisions); gzip; external.
2525
2526 'SearchableNamespaces': An option to modify which namespaces are searchable.
2527 &$arr: Array of namespaces ($nsId => $name) which will be used.
2528
2529 'SearchAfterNoDirectMatch': If there was no match for the exact result. This
2530 runs before lettercase variants are attempted, whereas 'SearchGetNearMatch'
2531 runs after.
2532 $term: Search term string
2533 &$title: Outparam; set to $title object and return false for a match
2534
2535 'SearchGetNearMatch': An extra chance for exact-title-matches in "go" searches
2536 if nothing was found.
2537 $term: Search term string
2538 &$title: Outparam; set to $title object and return false for a match
2539
2540 'SearchGetNearMatchBefore': Perform exact-title-matches in "go" searches before
2541 the normal operations.
2542 $allSearchTerms: Array of the search terms in all content languages
2543 &$titleResult: Outparam; the value to return. A Title object or null.
2544
2545 'SearchGetNearMatchComplete': A chance to modify exact-title-matches in "go"
2546 searches.
2547 $term: Search term string
2548 &$title: Current Title object that is being returned (null if none found).
2549
2550 'SearchResultInitFromTitle': Set the revision used when displaying a page in
2551 search results.
2552 $title: Current Title object being displayed in search results.
2553 &$id: Revision ID (default is false, for latest)
2554
2555 'SecondaryDataUpdates': Allows modification of the list of DataUpdates to
2556 perform when page content is modified. Currently called by
2557 AbstractContent::getSecondaryDataUpdates.
2558 $title: Title of the page that is being edited.
2559 $oldContent: Content object representing the page's content before the edit.
2560 $recursive: bool indicating whether DataUpdates should trigger recursive
2561 updates (relevant mostly for LinksUpdate).
2562 $parserOutput: ParserOutput representing the rendered version of the page
2563 after the edit.
2564 &$updates: a list of DataUpdate objects, to be modified or replaced by
2565 the hook handler.
2566
2567 'SelfLinkBegin': Called before a link to the current article is displayed to
2568 allow the display of the link to be customized.
2569 $nt: the Title object
2570 &$html: html to display for the link
2571 &$trail: optional text to display before $html
2572 &$prefix: optional text to display after $html
2573 &$ret: the value to return if your hook returns false
2574
2575 'SendWatchlistEmailNotification': Return true to send watchlist email
2576 notification
2577 $targetUser: the user whom to send watchlist email notification
2578 $title: the page title
2579 $enotif: EmailNotification object
2580
2581 'SessionCheckInfo': Validate a MediaWiki\Session\SessionInfo as it's being
2582 loaded from storage. Return false to prevent it from being used.
2583 &$reason: String rejection reason to be logged
2584 $info: MediaWiki\Session\SessionInfo being validated
2585 $request: WebRequest being loaded from
2586 $metadata: Array|false Metadata array for the MediaWiki\Session\Session
2587 $data: Array|false Data array for the MediaWiki\Session\Session
2588
2589 'SessionMetadata': Add metadata to a session being saved.
2590 $backend: MediaWiki\Session\SessionBackend being saved.
2591 &$metadata: Array Metadata to be stored. Add new keys here.
2592 $requests: Array of WebRequests potentially being saved to. Generally 0-1 real
2593 request and 0+ FauxRequests.
2594
2595 'SetupAfterCache': Called in Setup.php, after cache objects are set
2596
2597 'ShortPagesQuery': Allow extensions to modify the query used by
2598 Special:ShortPages.
2599 &$tables: tables to join in the query
2600 &$conds: conditions for the query
2601 &$joinConds: join conditions for the query
2602 &$options: options for the query
2603
2604 'ShowMissingArticle': Called when generating the output for a non-existent page.
2605 $article: The article object corresponding to the page
2606
2607 'ShowRawCssJs': DEPRECATED! Use the ContentGetParserOutput hook instead.
2608 Customise the output of raw CSS and JavaScript in page views.
2609 $text: Text being shown
2610 $title: Title of the custom script/stylesheet page
2611 $output: Current OutputPage object
2612
2613 'ShowSearchHit': Customize display of search hit.
2614 $searchPage: The SpecialSearch instance.
2615 $result: The SearchResult to show
2616 $terms: Search terms, for highlighting
2617 &$link: HTML of link to the matching page. May be modified.
2618 &$redirect: HTML of redirect info. May be modified.
2619 &$section: HTML of matching section. May be modified.
2620 &$extract: HTML of content extract. May be modified.
2621 &$score: HTML of score. May be modified.
2622 &$size: HTML of page size. May be modified.
2623 &$date: HTML of of page modification date. May be modified.
2624 &$related: HTML of additional info for the matching page. May be modified.
2625 &$html: May be set to the full HTML that should be used to represent the search
2626 hit. Must include the <li> ... </li> tags. Will only be used if the hook
2627 function returned false.
2628
2629 'ShowSearchHitTitle': Customise display of search hit title/link.
2630 &$title: Title to link to
2631 &$text: Text to use for the link
2632 $result: The search result
2633 $terms: The search terms entered
2634 $page: The SpecialSearch object
2635 &$query: Query string to be appended to the link
2636
2637 'SidebarBeforeOutput': Allows to edit sidebar just before it is output by skins.
2638 Warning: This hook is run on each display. You should consider to use
2639 'SkinBuildSidebar' that is aggressively cached.
2640 $skin: Skin object
2641 &$bar: Sidebar content
2642 Modify $bar to add or modify sidebar portlets.
2643
2644 'SiteNoticeAfter': After the sitenotice/anonnotice is composed.
2645 &$siteNotice: HTML sitenotice. Alter the contents of $siteNotice to add to/alter
2646 the sitenotice/anonnotice.
2647 $skin: Skin object
2648
2649 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed. Return true to
2650 allow the normal method of notice selection/rendering to work, or change the
2651 value of $siteNotice and return false to alter it.
2652 &$siteNotice: HTML returned as the sitenotice
2653 $skin: Skin object
2654
2655 'SkinAfterBottomScripts': At the end of Skin::bottomScripts().
2656 $skin: Skin object
2657 &$text: bottomScripts Text. Append to $text to add additional text/scripts after
2658 the stock bottom scripts.
2659
2660 'SkinAfterContent': Allows extensions to add text after the page content and
2661 article metadata. This hook should work in all skins. Set the &$data variable to
2662 the text you're going to add.
2663 &$data: (string) Text to be printed out directly (without parsing)
2664 $skin: Skin object
2665
2666 'SkinBuildSidebar': At the end of Skin::buildSidebar().
2667 $skin: Skin object
2668 &$bar: Sidebar contents
2669 Modify $bar to add or modify sidebar portlets.
2670
2671 'SkinCopyrightFooter': Allow for site and per-namespace customization of
2672 copyright notice.
2673 $title: displayed page title
2674 $type: 'normal' or 'history' for old/diff views
2675 &$msg: overridable message; usually 'copyright' or 'history_copyright'. This
2676 message must be in HTML format, not wikitext!
2677 &$link: overridable HTML link to be passed into the message as $1
2678 &$forContent: DEPRECATED! overridable flag if copyright footer is shown in
2679 content language.
2680
2681 'SkinEditSectionLinks': Modify the section edit links
2682 $skin: Skin object rendering the UI
2683 $title: Title object for the title being linked to (may not be the same as
2684 the page title, if the section is included from a template)
2685 $section: The designation of the section being pointed to, to be included in
2686 the link, like "&section=$section"
2687 $tooltip: The default tooltip. Escape before using.
2688 By default, this is wrapped in the 'editsectionhint' message.
2689 &$result: Array containing all link detail arrays. Each link detail array should
2690 contain the following keys:
2691 - targetTitle - Target Title object
2692 - text - String for the text
2693 - attribs - Array of attributes
2694 - query - Array of query parameters to add to the URL
2695 - options - Array of options for Linker::link
2696 $lang: The language code to use for the link in the wfMessage function
2697
2698 'SkinGetPoweredBy': TODO
2699 &$text: additional 'powered by' icons in HTML. Note: Modern skin does not use
2700 the MediaWiki icon but plain text instead.
2701 $skin: Skin object
2702
2703 'SkinPreloadExistence': Supply titles that should be added to link existence
2704 cache before the page is rendered.
2705 &$titles: Array of Title objects
2706 $skin: Skin object
2707
2708 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle().
2709 If false is returned $subpages will be used instead of the HTML
2710 subPageSubtitle() generates.
2711 If true is returned, $subpages will be ignored and the rest of
2712 subPageSubtitle() will run.
2713 &$subpages: Subpage links HTML
2714 $skin: Skin object
2715 $out: OutputPage object
2716
2717 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink': After creating the "permanent
2718 link" tab.
2719 &$sktemplate: SkinTemplate object
2720 &$nav_urls: array of tabs
2721 &$revid: The revision id of the permanent link
2722 &$revid2: The revision id of the permanent link, second time
2723
2724 'SkinTemplateGetLanguageLink': After building the data for a language link from
2725 which the actual html is constructed.
2726 &$languageLink: array containing data about the link. The following keys can be
2727 modified: href, text, title, class, lang, hreflang. Each of them is a string.
2728 $languageLinkTitle: Title object belonging to the external language link.
2729 $title: Title object of the page the link belongs to.
2730 $outputPage: The OutputPage object the links are built from.
2731
2732 'SkinTemplateNavigation': Called on content pages after the tabs have been
2733 added, but before variants have been added.
2734 &$sktemplate: SkinTemplate object
2735 &$links: Structured navigation links. This is used to alter the navigation for
2736 skins which use buildNavigationUrls such as Vector.
2737
2738 'SkinTemplateNavigation::SpecialPage': Called on special pages after the special
2739 tab is added but before variants have been added.
2740 &$sktemplate: SkinTemplate object
2741 &$links: Structured navigation links. This is used to alter the navigation for
2742 skins which use buildNavigationUrls such as Vector.
2743
2744 'SkinTemplateNavigation::Universal': Called on both content and special pages
2745 after variants have been added.
2746 &$sktemplate: SkinTemplate object
2747 &$links: Structured navigation links. This is used to alter the navigation for
2748 skins which use buildNavigationUrls such as Vector.
2749
2750 'SkinTemplateOutputPageBeforeExec': Before SkinTemplate::outputPage() starts
2751 page output.
2752 &$sktemplate: SkinTemplate object
2753 &$tpl: QuickTemplate engine object
2754
2755 'SkinTemplatePreventOtherActiveTabs': Use this to prevent showing active tabs.
2756 &$sktemplate: SkinTemplate object
2757 &$res: set to true to prevent active tabs
2758
2759 'SkinTemplateTabAction': Override SkinTemplate::tabAction().
2760 You can either create your own array, or alter the parameters for
2761 the normal one.
2762 &$sktemplate: The SkinTemplate instance.
2763 $title: Title instance for the page.
2764 $message: Visible label of tab.
2765 $selected: Whether this is a selected tab.
2766 $checkEdit: Whether or not the action=edit query should be added if appropriate.
2767 &$classes: Array of CSS classes to apply.
2768 &$query: Query string to add to link.
2769 &$text: Link text.
2770 &$result: Complete assoc. array if you want to return true.
2771
2772 'SkinTemplateToolboxEnd': Called by SkinTemplate skins after toolbox links have
2773 been rendered (useful for adding more).
2774 &$sk: The QuickTemplate based skin template running the hook.
2775 $dummy: Called when SkinTemplateToolboxEnd is used from a BaseTemplate skin,
2776 extensions that add support for BaseTemplateToolbox should watch for this
2777 dummy parameter with "$dummy=false" in their code and return without echoing
2778 any HTML to avoid creating duplicate toolbox items.
2779
2780 'SoftwareInfo': Called by Special:Version for returning information about the
2781 software.
2782 &$software: The array of software in format 'name' => 'version'. See
2783 SpecialVersion::softwareInformation().
2784
2785 'SpecialBlockModifyFormFields': Add more fields to Special:Block
2786 $sp: SpecialPage object, for context
2787 &$fields: Current HTMLForm fields
2788
2789 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions
2790 $id: User id number, only provided for backwards-compatibility
2791 $user: User object representing user contributions are being fetched for
2792 $sp: SpecialPage instance, providing context
2793
2794 'SpecialContributions::getForm::filters': Called with a list of filters to render
2795 on Special:Contributions.
2796 $sp: SpecialContributions object, for context
2797 &$filters: List of filters rendered as HTML
2798
2799 'SpecialListusersDefaultQuery': Called right before the end of
2800 UsersPager::getDefaultQuery().
2801 $pager: The UsersPager instance
2802 &$query: The query array to be returned
2803
2804 'SpecialListusersFormatRow': Called right before the end of
2805 UsersPager::formatRow().
2806 &$item: HTML to be returned. Will be wrapped in <li></li> after the hook finishes
2807 $row: Database row object
2808
2809 'SpecialListusersHeader': Called before closing the <fieldset> in
2810 UsersPager::getPageHeader().
2811 $pager: The UsersPager instance
2812 &$out: The header HTML
2813
2814 'SpecialListusersHeaderForm': Called before adding the submit button in
2815 UsersPager::getPageHeader().
2816 $pager: The UsersPager instance
2817 &$out: The header HTML
2818
2819 'SpecialListusersQueryInfo': Called right before the end of.
2820 UsersPager::getQueryInfo()
2821 $pager: The UsersPager instance
2822 &$query: The query array to be returned
2823
2824 'SpecialLogAddLogSearchRelations': Add log relations to the current log
2825 $type: String of the log type
2826 $request: WebRequest object for getting the value provided by the current user
2827 &$qc: Array for query conditions to add
2828
2829 'SpecialMovepageAfterMove': Called after moving a page.
2830 &$movePage: MovePageForm object
2831 &$oldTitle: old title (object)
2832 &$newTitle: new title (object)
2833
2834 'SpecialNewpagesConditions': Called when building sql query for
2835 Special:NewPages.
2836 &$special: NewPagesPager object (subclass of ReverseChronologicalPager)
2837 $opts: FormOptions object containing special page options
2838 &$conds: array of WHERE conditionals for query
2839 &$tables: array of tables to be queried
2840 &$fields: array of columns to select
2841 &$join_conds: join conditions for the tables
2842
2843 'SpecialNewPagesFilters': Called after building form options at NewPages.
2844 $special: the special page object
2845 &$filters: associative array of filter definitions. The keys are the HTML
2846 name/URL parameters. Each key maps to an associative array with a 'msg'
2847 (message key) and a 'default' value.
2848
2849 'SpecialPage_initList': Called when setting up SpecialPageFactory::$list, use
2850 this hook to remove a core special page or conditionally register special pages.
2851 &$list: list (array) of core special pages
2852
2853 'SpecialPageAfterExecute': Called after SpecialPage::execute.
2854 $special: the SpecialPage object
2855 $subPage: the subpage string or null if no subpage was specified
2856
2857 'SpecialPageBeforeExecute': Called before SpecialPage::execute.
2858 $special: the SpecialPage object
2859 $subPage: the subpage string or null if no subpage was specified
2860
2861 'SpecialPageBeforeFormDisplay': Before executing the HTMLForm object.
2862 $name: name of the special page
2863 &$form: HTMLForm object
2864
2865 'SpecialPasswordResetOnSubmit': When executing a form submission on
2866 Special:PasswordReset.
2867 &$users: array of User objects.
2868 $data: array of data submitted by the user
2869 &$error: string, error code (message key) used to describe to error (out
2870 parameter). The hook needs to return false when setting this, otherwise it
2871 will have no effect.
2872
2873 'SpecialRandomGetRandomTitle': Called during the execution of Special:Random,
2874 use this to change some selection criteria or substitute a different title.
2875 &$randstr: The random number from wfRandom()
2876 &$isRedir: Boolean, whether to select a redirect or non-redirect
2877 &$namespaces: An array of namespace indexes to get the title from
2878 &$extra: An array of extra SQL statements
2879 &$title: If the hook returns false, a Title object to use instead of the
2880 result from the normal query
2881
2882 'SpecialRecentChangesFilters': DEPRECATED! Use ChangesListSpecialPageFilters
2883 instead.
2884 Called after building form options at RecentChanges.
2885 $special: the special page object
2886 &$filters: associative array of filter definitions. The keys are the HTML
2887 name/URL parameters. Each key maps to an associative array with a 'msg'
2888 (message key) and a 'default' value.
2889
2890 'SpecialRecentChangesPanel': Called when building form options in
2891 SpecialRecentChanges.
2892 &$extraOpts: array of added items, to which can be added
2893 $opts: FormOptions for this request
2894
2895 'SpecialRecentChangesQuery': DEPRECATED! Use ChangesListSpecialPageQuery
2896 instead.
2897 Called when building SQL query for SpecialRecentChanges and
2898 SpecialRecentChangesLinked.
2899 &$conds: array of WHERE conditionals for query
2900 &$tables: array of tables to be queried
2901 &$join_conds: join conditions for the tables
2902 $opts: FormOptions for this request
2903 &$query_options: array of options for the database request
2904 &$select: Array of columns to select
2905
2906 'SpecialResetTokensTokens': Called when building token list for
2907 SpecialResetTokens.
2908 &$tokens: array of token information arrays in the format of
2909 array(
2910 'preference' => '<preference-name>',
2911 'label-message' => '<message-key>',
2912 )
2913
2914 'SpecialSearchCreateLink': Called when making the message to create a page or
2915 go to the existing page.
2916 $t: title object searched for
2917 &$params: an array of the default message name and page title (as parameter)
2918
2919 'SpecialSearchGoResult': If a hook returns false the 'go' feature will be
2920 canceled and a normal search will be performed. Returning true without setting
2921 $url does a standard redirect to $title. Setting $url redirects to the
2922 specified URL.
2923 $term - The string the user searched for
2924 $title - The title the 'go' feature has decided to forward the user to
2925 &$url - Initially null, hook subscribers can set this to specify the final url to redirect to
2926
2927 'SpecialSearchNogomatch': Called when user clicked the "Go" button but the
2928 target doesn't exist.
2929 &$title: title object generated from the text entered by the user
2930
2931 'SpecialSearchPowerBox': The equivalent of SpecialSearchProfileForm for
2932 the advanced form, a.k.a. power search box.
2933 &$showSections: an array to add values with more options to
2934 $term: the search term (not a title object)
2935 $opts: an array of hidden options (containing 'redirs' and 'profile')
2936
2937 'SpecialSearchProfileForm': Allows modification of search profile forms.
2938 $search: special page object
2939 &$form: String: form html
2940 $profile: String: current search profile
2941 $term: String: search term
2942 $opts: Array: key => value of hidden options for inclusion in custom forms
2943
2944 'SpecialSearchProfiles': Allows modification of search profiles.
2945 &$profiles: profiles, which can be modified.
2946
2947 'SpecialSearchResults': Called before search result display
2948 $term: string of search term
2949 &$titleMatches: empty or SearchResultSet object
2950 &$textMatches: empty or SearchResultSet object
2951
2952 'SpecialSearchResultsPrepend': Called immediately before returning HTML
2953 on the search results page. Useful for including an external search
2954 provider. To disable the output of MediaWiki search output, return
2955 false.
2956 $specialSearch: SpecialSearch object ($this)
2957 $output: $wgOut
2958 $term: Search term specified by the user
2959
2960 'SpecialSearchResultsAppend': Called immediately before returning HTML
2961 on the search results page. Useful for including a feedback link.
2962 $specialSearch: SpecialSearch object ($this)
2963 $output: $wgOut
2964 $term: Search term specified by the user
2965
2966 'SpecialSearchSetupEngine': Allows passing custom data to search engine.
2967 $search: SpecialSearch special page object
2968 $profile: String: current search profile
2969 $engine: the search engine
2970
2971 'SpecialStatsAddExtra': Add extra statistic at the end of Special:Statistics.
2972 &$extraStats: Array to save the new stats
2973 $extraStats['<name of statistic>'] => <value>;
2974 <value> can be an array with the keys "name" and "number":
2975 "name" is the HTML to be displayed in the name column
2976 "number" is the number to be displayed.
2977 or, <value> can be the number to be displayed and <name> is the
2978 message key to use in the name column,
2979 $context: IContextSource object
2980
2981 'SpecialUploadComplete': Called after successfully uploading a file from
2982 Special:Upload.
2983 &$form: The SpecialUpload object
2984
2985 'SpecialVersionVersionUrl': Called when building the URL for Special:Version.
2986 $wgVersion: Current $wgVersion for you to use
2987 &$versionUrl: Raw url to link to (eg: release notes)
2988
2989 'SpecialWatchlistFilters': DEPRECATED! Use ChangesListSpecialPageFilters
2990 instead.
2991 Called after building form options at Watchlist.
2992 $special: the special page object
2993 &$filters: associative array of filter definitions. The keys are the HTML
2994 name/URL parameters. Each key maps to an associative array with a 'msg'
2995 (message key) and a 'default' value.
2996
2997 'SpecialWatchlistGetNonRevisionTypes': Called when building sql query for
2998 SpecialWatchlist. Allows extensions to register custom values they have
2999 inserted to rc_type so they can be returned as part of the watchlist.
3000 &$nonRevisionTypes: array of values in the rc_type field of recentchanges table
3001
3002 'SpecialWatchlistQuery': DEPRECATED! Use ChangesListSpecialPageQuery instead.
3003 Called when building sql query for SpecialWatchlist.
3004 &$conds: array of WHERE conditionals for query
3005 &$tables: array of tables to be queried
3006 &$join_conds: join conditions for the tables
3007 &$fields: array of query fields
3008 $opts: A FormOptions object with watchlist options for the current request
3009
3010 'TestCanonicalRedirect': Called when about to force a redirect to a canonical
3011 URL for a title when we have no other parameters on the URL. Gives a chance for
3012 extensions that alter page view behavior radically to abort that redirect or
3013 handle it manually.
3014 $request: WebRequest
3015 $title: Title of the currently found title obj
3016 $output: OutputPage object
3017
3018 'ThumbnailBeforeProduceHTML': Called before an image HTML is about to be
3019 rendered (by ThumbnailImage:toHtml method).
3020 $thumbnail: the ThumbnailImage object
3021 &$attribs: image attribute array
3022 &$linkAttribs: image link attribute array
3023
3024 'TitleArrayFromResult': Called when creating an TitleArray object from a
3025 database result.
3026 &$titleArray: set this to an object to override the default object returned
3027 $res: database result used to create the object
3028
3029 'TitleExists': Called when determining whether a page exists at a given title.
3030 $title: The title being tested.
3031 &$exists: Whether the title exists.
3032
3033 'TitleGetEditNotices': Allows extensions to add edit notices
3034 $title: The Title object for the page the edit notices are for
3035 $oldid: Revision ID that the edit notices are for (or 0 for latest)
3036 &$notices: Array of notices. Keys are i18n message keys, values are
3037 parseAsBlock()ed messages.
3038
3039 'TitleGetRestrictionTypes': Allows extensions to modify the types of protection
3040 that can be applied.
3041 $title: The title in question.
3042 &$types: The types of protection available.
3043
3044 'TitleIsAlwaysKnown': Called when determining if a page exists. Allows
3045 overriding default behavior for determining if a page exists. If $isKnown is
3046 kept as null, regular checks happen. If it's a boolean, this value is returned
3047 by the isKnown method.
3048 $title: Title object that is being checked
3049 &$isKnown: Boolean|null; whether MediaWiki currently thinks this page is known
3050
3051 'TitleIsCssOrJsPage': DEPRECATED! Use ContentHandlerDefaultModelFor instead.
3052 Called when determining if a page is a CSS or JS page.
3053 $title: Title object that is being checked
3054 &$result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page.
3055 Hooks may change this value to override the return value of
3056 Title::isCssOrJsPage().
3057
3058 'TitleIsMovable': Called when determining if it is possible to move a page. Note
3059 that this hook is not called for interwiki pages or pages in immovable
3060 namespaces: for these, isMovable() always returns false.
3061 $title: Title object that is being checked
3062 &$result: Boolean; whether MediaWiki currently thinks this page is movable.
3063 Hooks may change this value to override the return value of
3064 Title::isMovable().
3065
3066 'TitleIsWikitextPage': DEPRECATED! Use ContentHandlerDefaultModelFor instead.
3067 Called when determining if a page is a wikitext or should
3068 be handled by separate handler (via ArticleViewCustom).
3069 $title: Title object that is being checked
3070 &$result: Boolean; whether MediaWiki currently thinks this is a wikitext page.
3071 Hooks may change this value to override the return value of
3072 Title::isWikitextPage()
3073
3074 'TitleMove': Before moving an article (title).
3075 $old: old title
3076 $nt: new title
3077 $user: user who does the move
3078
3079 'TitleMoveStarting': Before moving an article (title), but just after the atomic DB section starts.
3080 $old: old title
3081 $nt: new title
3082 $user: user who does the move
3083
3084 'TitleMoveComplete': After moving an article (title), post-commit.
3085 &$old: old title
3086 &$nt: new title
3087 &$user: user who did the move
3088 $pageid: database ID of the page that's been moved
3089 $redirid: database ID of the created redirect
3090 $reason: reason for the move
3091 $revision: the Revision created by the move
3092
3093 'TitleMoveCompleting': After moving an article (title), pre-commit.
3094 $old: old title
3095 $nt: new title
3096 $user: user who did the move
3097 $pageid: database ID of the page that's been moved
3098 $redirid: database ID of the created redirect
3099 $reason: reason for the move
3100 $revision: the Revision created by the move
3101
3102 'TitleQuickPermissions': Called from Title::checkQuickPermissions to add to
3103 or override the quick permissions check.
3104 $title: The Title object being accessed
3105 $user: The User performing the action
3106 $action: Action being performed
3107 &$errors: Array of errors
3108 $doExpensiveQueries: Whether to do expensive DB queries
3109 $short: Whether to return immediately on first error
3110
3111 'TitleReadWhitelist': Called at the end of read permissions checks, just before
3112 adding the default error message if nothing allows the user to read the page. If
3113 a handler wants a title to *not* be whitelisted, it should also return false.
3114 $title: Title object being checked against
3115 $user: Current user object
3116 &$whitelisted: Boolean value of whether this title is whitelisted
3117
3118 'TitleSquidURLs': Called to determine which URLs to purge from HTTP caches.
3119 $title: Title object to purge
3120 &$urls: An array of URLs to purge from the caches, to be manipulated.
3121
3122 'UndeleteForm::showHistory': Called in UndeleteForm::showHistory, after a
3123 PageArchive object has been created but before any further processing is done.
3124 &$archive: PageArchive object
3125 $title: Title object of the page that we're viewing
3126
3127 'UndeleteForm::showRevision': Called in UndeleteForm::showRevision, after a
3128 PageArchive object has been created but before any further processing is done.
3129 &$archive: PageArchive object
3130 $title: Title object of the page that we're viewing
3131
3132 'UndeleteForm::undelete': Called un UndeleteForm::undelete, after checking that
3133 the site is not in read-only mode, that the Title object is not null and after
3134 a PageArchive object has been constructed but before performing any further
3135 processing.
3136 &$archive: PageArchive object
3137 $title: Title object of the page that we're about to undelete
3138
3139 'UndeleteShowRevision': Called when showing a revision in Special:Undelete.
3140 $title: title object related to the revision
3141 $rev: revision (object) that will be viewed
3142
3143 'UnitTestsList': Called when building a list of paths containing PHPUnit tests.
3144 Since 1.24: Paths pointing to a directory will be recursively scanned for
3145 test case files matching the suffix "Test.php".
3146 &$paths: list of test cases and directories to search.
3147
3148 'UnknownAction': An unknown "action" has occurred (useful for defining your own
3149 actions).
3150 $action: action name
3151 $article: article "acted on"
3152
3153 'UnwatchArticle': Before a watch is removed from an article.
3154 &$user: user watching
3155 &$page: WikiPage object to be removed
3156 &$status: Status object to be returned if the hook returns false
3157
3158 'UnwatchArticleComplete': After a watch is removed from an article.
3159 $user: user that watched
3160 &$page: WikiPage object that was watched
3161
3162 'UpdateUserMailerFormattedPageStatus': Before notification email gets sent.
3163 &$formattedPageStatus: list of valid page states
3164
3165 'UploadComplete': Upon completion of a file upload.
3166 &$uploadBase: UploadBase (or subclass) object. File can be accessed by
3167 $uploadBase->getLocalFile().
3168
3169 'UploadCreateFromRequest': When UploadBase::createFromRequest has been called.
3170 $type: (string) the requested upload type
3171 &$className: the class name of the Upload instance to be created
3172
3173 'UploadForm:BeforeProcessing': At the beginning of processUpload(). Lets you
3174 poke at member variables like $mUploadDescription before the file is saved. Do
3175 not use this hook to break upload processing. This will return the user to a
3176 blank form with no error message; use UploadVerification and UploadVerifyFile
3177 instead.
3178 &$form: UploadForm object
3179
3180 'UploadForm:initial': Before the upload form is generated. You might set the
3181 member-variables $uploadFormTextTop and $uploadFormTextAfterSummary to inject
3182 text (HTML) either before or after the editform.
3183 &$form: UploadForm object
3184
3185 'UploadFormInitDescriptor': After the descriptor for the upload form as been
3186 assembled.
3187 &$descriptor: (array) the HTMLForm descriptor
3188
3189 'UploadFormSourceDescriptors': after the standard source inputs have been
3190 added to the descriptor
3191 &$descriptor: (array) the HTMLForm descriptor
3192 &$radio: Boolean, if source type should be shown as radio button
3193 $selectedSourceType: The selected source type
3194
3195 'UploadVerification': Additional chances to reject an uploaded file. Consider
3196 using UploadVerifyFile instead.
3197 $saveName: (string) destination file name
3198 $tempName: (string) filesystem path to the temporary file for checks
3199 &$error: (string) output: message key for message to show if upload canceled by
3200 returning false. May also be an array, where the first element is the message
3201 key and the remaining elements are used as parameters to the message.
3202
3203 'UploadVerifyFile': extra file verification, based on MIME type, etc. Preferred
3204 in most cases over UploadVerification.
3205 $upload: (object) an instance of UploadBase, with all info about the upload
3206 $mime: (string) The uploaded file's MIME type, as detected by MediaWiki.
3207 Handlers will typically only apply for specific MIME types.
3208 &$error: (object) output: true if the file is valid. Otherwise, an indexed array
3209 representing the problem with the file, where the first element is the message
3210 key and the remaining elements are used as parameters to the message.
3211
3212 'User::mailPasswordInternal': before creation and mailing of a user's new
3213 temporary password
3214 &$user: the user who sent the message out
3215 &$ip: IP of the user who sent the message out
3216 &$u: the account whose new password will be set
3217
3218 'UserAddGroup': Called when adding a group; return false to override
3219 stock group addition.
3220 $user: the user object that is to have a group added
3221 &$group: the group to add, can be modified
3222
3223 'UserArrayFromResult': Called when creating an UserArray object from a database
3224 result.
3225 &$userArray: set this to an object to override the default object returned
3226 $res: database result used to create the object
3227
3228 'userCan': To interrupt/advise the "user can do X to Y article" check. If you
3229 want to display an error message, try getUserPermissionsErrors.
3230 &$title: Title object being checked against
3231 &$user: Current user object
3232 $action: Action being checked
3233 &$result: Pointer to result returned if hook returns false. If null is returned,
3234 userCan checks are continued by internal code.
3235
3236 'UserCanSendEmail': To override User::canSendEmail() permission check.
3237 &$user: User (object) whose permission is being checked
3238 &$canSend: bool set on input, can override on output
3239
3240 'UserClearNewTalkNotification': Called when clearing the "You have new
3241 messages!" message, return false to not delete it.
3242 &$user: User (object) that will clear the message
3243 $oldid: ID of the talk page revision being viewed (0 means the most recent one)
3244
3245 'UserCreateForm': change to manipulate the login form
3246 &$template: SimpleTemplate instance for the form
3247
3248 'UserEffectiveGroups': Called in User::getEffectiveGroups().
3249 &$user: User to get groups for
3250 &$groups: Current effective groups
3251
3252 'UserGetAllRights': After calculating a list of all available rights.
3253 &$rights: Array of rights, which may be added to.
3254
3255 'UserGetDefaultOptions': After fetching the core default, this hook is run right
3256 before returning the options to the caller. Warning: This hook is called for
3257 every call to User::getDefaultOptions(), which means it's potentially called
3258 dozens or hundreds of times. You may want to cache the results of non-trivial
3259 operations in your hook function for this reason.
3260 &$defaultOptions: Array of preference keys and their default values.
3261
3262 'UserGetEmail': Called when getting an user email address.
3263 $user: User object
3264 &$email: email, change this to override local email
3265
3266 'UserGetEmailAuthenticationTimestamp': Called when getting the timestamp of
3267 email authentication.
3268 $user: User object
3269 &$timestamp: timestamp, change this to override local email authentication
3270 timestamp
3271
3272 'UserGetImplicitGroups': DEPRECATED!
3273 Called in User::getImplicitGroups().
3274 &$groups: List of implicit (automatically-assigned) groups
3275
3276 'UserGetLanguageObject': Called when getting user's interface language object.
3277 $user: User object
3278 &$code: Language code that will be used to create the object
3279 $context: IContextSource object
3280
3281 'UserGetReservedNames': Allows to modify $wgReservedUsernames at run time.
3282 &$reservedUsernames: $wgReservedUsernames
3283
3284 'UserGetRights': Called in User::getRights().
3285 $user: User to get rights for
3286 &$rights: Current rights
3287
3288 'UserGroupsChanged': Called after user groups are changed.
3289 $user: User whose groups changed
3290 $added: Groups added
3291 $removed: Groups removed
3292 $performer: User who performed the change, false if via autopromotion
3293 $reason: The reason, if any, given by the user performing the change,
3294 false if via autopromotion.
3295
3296 'UserIsBlockedFrom': Check if a user is blocked from a specific page (for
3297 specific block exemptions).
3298 $user: User in question
3299 $title: Title of the page in question
3300 &$blocked: Out-param, whether or not the user is blocked from that page.
3301 &$allowUsertalk: If the user is blocked, whether or not the block allows users
3302 to edit their own user talk pages.
3303
3304 'UserIsBlockedGlobally': Check if user is blocked on all wikis.
3305 &$user: User object
3306 $ip: User's IP address
3307 &$blocked: Whether the user is blocked, to be modified by the hook
3308
3309 'UserIsEveryoneAllowed': Check if all users are allowed some user right; return
3310 false if a UserGetRights hook might remove the named right.
3311 $right: The user right being checked
3312
3313 'UserIsHidden': Check if the user's name should be hidden. See User::isHidden().
3314 $user: User in question.
3315 &$hidden: Set true if the user's name should be hidden.
3316
3317 'UserIsLocked': Check if the user is locked. See User::isLocked().
3318 $user: User in question.
3319 &$locked: Set true if the user should be locked.
3320
3321 'UserLoadAfterLoadFromSession': Called to authenticate users on external or
3322 environmental means; occurs after session is loaded.
3323 $user: user object being loaded
3324
3325 'UserLoadDefaults': Called when loading a default user.
3326 $user: user object
3327 $name: user name
3328
3329 'UserLoadFromDatabase': Called when loading a user from the database.
3330 $user: user object
3331 &$s: database query object
3332
3333 'UserLoadFromSession': DEPRECATED! Create a MediaWiki\Session\SessionProvider instead.
3334 Called to authenticate users on external/environmental means; occurs before
3335 session is loaded.
3336 $user: user object being loaded
3337 &$result: set this to a boolean value to abort the normal authentication
3338 process
3339
3340 'UserLoadOptions': When user options/preferences are being loaded from the
3341 database.
3342 $user: User object
3343 &$options: Options, can be modified.
3344
3345 'UserLoggedIn': Called after a user is logged in
3346 $user: User object for the logged-in user
3347
3348 'UserLoginComplete': After a user has logged in.
3349 &$user: the user object that was created on login
3350 &$inject_html: Any HTML to inject after the "logged in" message.
3351
3352 'UserLoginForm': change to manipulate the login form
3353 &$template: SimpleTemplate instance for the form
3354
3355 'UserLogout': Before a user logs out.
3356 &$user: the user object that is about to be logged out
3357
3358 'UserLogoutComplete': After a user has logged out.
3359 &$user: the user object _after_ logout (won't have name, ID, etc.)
3360 &$inject_html: Any HTML to inject after the "logged out" message.
3361 $oldName: name of the user before logout (string)
3362
3363 'UserMailerChangeReturnPath': Called to generate a VERP return address
3364 when UserMailer sends an email, with a bounce handling extension.
3365 $to: Array of MailAddress objects for the recipients
3366 &$returnPath: The return address string
3367
3368 'UserMailerSplitTo': Called in UserMailer::send() to give extensions a chance
3369 to split up an email with multiple the To: field into separate emails.
3370 &$to: array of MailAddress objects; unset the ones which should be mailed separately
3371
3372 'UserMailerTransformContent': Called in UserMailer::send() to change email contents.
3373 Extensions can block sending the email by returning false and setting $error.
3374 $to: array of MailAdresses of the targets
3375 $from: MailAddress of the sender
3376 &$body: email body, either a string (for plaintext emails) or an array with 'text' and 'html' keys
3377 &$error: should be set to an error message string
3378
3379 'UserMailerTransformMessage': Called in UserMailer::send() to change email after it has gone through
3380 the MIME transform. Extensions can block sending the email by returning false and setting $error.
3381 $to: array of MailAdresses of the targets
3382 $from: MailAddress of the sender
3383 &$subject: email subject (not MIME encoded)
3384 &$headers: email headers (except To: and Subject:) as an array of header name => value pairs
3385 &$body: email body (in MIME format) as a string
3386 &$error: should be set to an error message string
3387
3388 'UserRemoveGroup': Called when removing a group; return false to override stock
3389 group removal.
3390 $user: the user object that is to have a group removed
3391 &$group: the group to be removed, can be modified
3392
3393 'UserRequiresHTTPS': Called to determine whether a user needs
3394 to be switched to HTTPS.
3395 $user: User in question.
3396 &$https: Boolean whether $user should be switched to HTTPS.
3397
3398 'UserResetAllOptions': Called in User::resetOptions() when user preferences
3399 have been requested to be reset. This hook can be used to exclude certain
3400 options from being reset even when the user has requested all prefs to be reset,
3401 because certain options might be stored in the user_properties database table
3402 despite not being visible and editable via Special:Preferences.
3403 $user: the User (object) whose preferences are being reset
3404 &$newOptions: array of new (site default) preferences
3405 $options: array of the user's old preferences
3406 $resetKinds: array containing the kinds of preferences to reset
3407
3408 'UserRetrieveNewTalks': Called when retrieving "You have new messages!"
3409 message(s).
3410 &$user: user retrieving new talks messages
3411 &$talks: array of new talks page(s)
3412
3413 'UserRights': DEPRECATED! Use UserGroupsChanged instead.
3414 After a user's group memberships are changed.
3415 &$user: User object that was changed
3416 $add: Array of strings corresponding to groups added
3417 $remove: Array of strings corresponding to groups removed
3418
3419 'UserSaveOptions': Called just before saving user preferences/options.
3420 $user: User object
3421 &$options: Options, modifiable
3422
3423 'UserSaveSettings': Called when saving user settings.
3424 $user: User object
3425
3426 'UserSetCookies': DEPRECATED! If you're trying to replace core session cookie
3427 handling, you want to create a subclass of MediaWiki\Session\CookieSessionProvider
3428 instead. Otherwise, you can no longer count on user data being saved to cookies
3429 versus some other mechanism.
3430 Called when setting user cookies.
3431 $user: User object
3432 &$session: session array, will be added to the session
3433 &$cookies: cookies array mapping cookie name to its value
3434
3435 'UserSetEmail': Called when changing user email address.
3436 $user: User object
3437 &$email: new email, change this to override new email address
3438
3439 'UserSetEmailAuthenticationTimestamp': Called when setting the timestamp of
3440 email authentication.
3441 $user: User object
3442 &$timestamp: new timestamp, change this to override local email
3443 authentication timestamp
3444
3445 'UserToolLinksEdit': Called when generating a list of user tool links, e.g.
3446 "Foobar (Talk | Contribs | Block)".
3447 $userId: User id of the current user
3448 $userText: User name of the current user
3449 &$items: Array of user tool links as HTML fragments
3450
3451 'ValidateExtendedMetadataCache': Called to validate the cached metadata in
3452 FormatMetadata::getExtendedMeta (return false means cache will be
3453 invalidated and GetExtendedMetadata hook called again).
3454 $timestamp: The timestamp metadata was generated
3455 $file: The file the metadata is for
3456
3457 'WantedPages::getQueryInfo': Called in WantedPagesPage::getQueryInfo(), can be
3458 used to alter the SQL query which gets the list of wanted pages.
3459 &$wantedPages: WantedPagesPage object
3460 &$query: query array, see QueryPage::getQueryInfo() for format documentation
3461
3462 'WatchArticle': Before a watch is added to an article.
3463 &$user: user that will watch
3464 &$page: WikiPage object to be watched
3465 &$status: Status object to be returned if the hook returns false
3466
3467 'WatchArticleComplete': After a watch is added to an article.
3468 &$user: user that watched
3469 &$page: WikiPage object watched
3470
3471 'WatchlistEditorBeforeFormRender': Before building the Special:EditWatchlist
3472 form, used to manipulate the list of pages or preload data based on that list.
3473 &$watchlistInfo: array of watchlisted pages in
3474 [namespaceId => ['title1' => 1, 'title2' => 1]] format
3475
3476 'WatchlistEditorBuildRemoveLine': when building remove lines in
3477 Special:Watchlist/edit.
3478 &$tools: array of extra links
3479 $title: Title object
3480 $redirect: whether the page is a redirect
3481 $skin: Skin object
3482 &$link: HTML link to title
3483
3484 'WebRequestPathInfoRouter': While building the PathRouter to parse the
3485 REQUEST_URI.
3486 $router: The PathRouter instance
3487
3488 'WebResponseSetCookie': when setting a cookie in WebResponse::setcookie().
3489 Return false to prevent setting of the cookie.
3490 &$name: Cookie name passed to WebResponse::setcookie()
3491 &$value: Cookie value passed to WebResponse::setcookie()
3492 &$expire: Cookie expiration, as for PHP's setcookie()
3493 &$options: Options passed to WebResponse::setcookie()
3494
3495 'wfShellWikiCmd': Called when generating a shell-escaped command line string to
3496 run a MediaWiki cli script.
3497 &$script: MediaWiki cli script path
3498 &$parameters: Array of arguments and options to the script
3499 &$options: Associative array of options, may contain the 'php' and 'wrapper'
3500 keys
3501
3502 'wgQueryPages': Called when initialising list of QueryPage subclasses, use this
3503 to add new query pages to be updated with maintenance/updateSpecialPages.php.
3504 &$qp: The list of QueryPages
3505
3506 'WhatLinksHereProps': Allows annotations to be added to WhatLinksHere
3507 $row: The DB row of the entry.
3508 $title: The Title of the page where the link comes FROM
3509 $target: The Title of the page where the link goes TO
3510 &$props: Array of HTML strings to display after the title.
3511
3512 'WikiExporter::dumpStableQuery': Get the SELECT query for "stable" revisions
3513 dumps. One, and only one hook should set this, and return false.
3514 &$tables: Database tables to use in the SELECT query
3515 &$opts: Options to use for the query
3516 &$join: Join conditions
3517
3518 'WikiPageDeletionUpdates': manipulate the list of DataUpdates to be applied when
3519 a page is deleted. Called in WikiPage::getDeletionUpdates(). Note that updates
3520 specific to a content model should be provided by the respective Content's
3521 getDeletionUpdates() method.
3522 $page: the WikiPage
3523 $content: the Content to generate updates for
3524 &$updates: the array of DataUpdate objects. Hook function may want to add to it.
3525
3526 'XmlDumpWriterOpenPage': Called at the end of XmlDumpWriter::openPage, to allow
3527 extra metadata to be added.
3528 $obj: The XmlDumpWriter object.
3529 &$out: The output string.
3530 $row: The database row for the page.
3531 $title: The title of the page.
3532
3533 'XmlDumpWriterWriteRevision': Called at the end of a revision in an XML dump, to
3534 add extra metadata.
3535 &$obj: The XmlDumpWriter object.
3536 &$out: The text being output.
3537 $row: The database row for the revision.
3538 $text: The revision text.
3539
3540 More hooks might be available but undocumented, you can execute
3541 "php maintenance/findHooks.php" to find hidden ones.