hooks.txt 178 KB

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