MediaWiki master
MediaWiki\HookContainer\HookRunner Class Reference

This class provides an implementation of the core hook interfaces, forwarding hook calls to HookContainer for dispatch to extensions. More...

Inherits MediaWiki\Actions\Hook\GetActionNameHook, MediaWiki\Auth\Hook\AuthManagerLoginAuthenticateAuditHook, MediaWiki\Auth\Hook\ExemptFromAccountCreationThrottleHook, MediaWiki\Auth\Hook\LocalUserCreatedHook, MediaWiki\Auth\Hook\ResetPasswordExpirationHook, MediaWiki\Auth\Hook\SecuritySensitiveOperationStatusHook, MediaWiki\Auth\Hook\UserLoggedInHook, MediaWiki\Block\Hook\AbortAutoblockHook, MediaWiki\Block\Hook\GetAllBlockActionsHook, MediaWiki\Block\Hook\GetUserBlockHook, MediaWiki\Block\Hook\PerformRetroactiveAutoblockHook, MediaWiki\Cache\Hook\BacklinkCacheGetConditionsHook, MediaWiki\Cache\Hook\BacklinkCacheGetPrefixHook, MediaWiki\Cache\Hook\HtmlCacheUpdaterAppendUrlsHook, MediaWiki\Cache\Hook\HtmlCacheUpdaterVaryUrlsHook, MediaWiki\Cache\Hook\HTMLFileCache__useFileCacheHook, MediaWiki\Cache\Hook\MessageCacheFetchOverridesHook, MediaWiki\Cache\Hook\MessageCacheReplaceHook, MediaWiki\Cache\Hook\MessageCache__getHook, MediaWiki\Cache\Hook\MessagesPreLoadHook, MediaWiki\Hook\TitleSquidURLsHook, MediaWiki\ChangeTags\Hook\ChangeTagAfterDeleteHook, MediaWiki\ChangeTags\Hook\ChangeTagCanCreateHook, MediaWiki\ChangeTags\Hook\ChangeTagCanDeleteHook, MediaWiki\ChangeTags\Hook\ChangeTagsAfterUpdateTagsHook, MediaWiki\ChangeTags\Hook\ChangeTagsAllowedAddHook, MediaWiki\ChangeTags\Hook\ChangeTagsListActiveHook, MediaWiki\ChangeTags\Hook\ListDefinedTagsHook, MediaWiki\Content\Hook\ContentAlterParserOutputHook, MediaWiki\Content\Hook\ContentGetParserOutputHook, MediaWiki\Content\Hook\ContentHandlerForModelIDHook, MediaWiki\Content\Hook\ContentModelCanBeUsedOnHook, MediaWiki\Content\Hook\ConvertContentHook, MediaWiki\Content\Hook\GetContentModelsHook, MediaWiki\Content\Hook\GetDifferenceEngineHook, MediaWiki\Content\Hook\GetSlotDiffRendererHook, MediaWiki\Content\Hook\JsonValidateSaveHook, MediaWiki\Content\Hook\PageContentLanguageHook, MediaWiki\Content\Hook\PlaceNewSectionHook, MediaWiki\Content\Hook\SearchDataForIndexHook, MediaWiki\Content\Hook\SearchDataForIndex2Hook, MediaWiki\Specials\Contribute\Hook\ContributeCardsHook, MediaWiki\Diff\Hook\AbortDiffCacheHook, MediaWiki\Diff\Hook\ArticleContentOnDiffHook, MediaWiki\Diff\Hook\DifferenceEngineAfterLoadNewTextHook, MediaWiki\Diff\Hook\TextSlotDiffRendererTablePrefixHook, MediaWiki\Diff\Hook\DifferenceEngineLoadTextAfterNewContentIsLoadedHook, MediaWiki\Diff\Hook\DifferenceEngineMarkPatrolledLinkHook, MediaWiki\Diff\Hook\DifferenceEngineMarkPatrolledRCIDHook, MediaWiki\Diff\Hook\DifferenceEngineNewHeaderHook, MediaWiki\Diff\Hook\DifferenceEngineOldHeaderHook, MediaWiki\Diff\Hook\DifferenceEngineOldHeaderNoOldRevHook, MediaWiki\Diff\Hook\DifferenceEngineRenderRevisionAddParserOutputHook, MediaWiki\Diff\Hook\DifferenceEngineRenderRevisionShowFinalPatrolLinkHook, MediaWiki\Diff\Hook\DifferenceEngineShowDiffHook, MediaWiki\Diff\Hook\DifferenceEngineShowDiffPageHook, MediaWiki\Diff\Hook\DifferenceEngineShowDiffPageMaybeShowMissingRevisionHook, MediaWiki\Diff\Hook\DifferenceEngineShowEmptyOldContentHook, MediaWiki\Diff\Hook\DifferenceEngineViewHeaderHook, MediaWiki\Diff\Hook\DiffToolsHook, MediaWiki\Diff\Hook\NewDifferenceEngineHook, MediaWiki\Hook\AbortEmailNotificationHook, MediaWiki\Hook\AbortTalkPageEmailNotificationHook, MediaWiki\Hook\ActionBeforeFormDisplayHook, MediaWiki\Hook\ActionModifyFormFieldsHook, MediaWiki\Hook\AddNewAccountHook, MediaWiki\Output\Hook\AfterBuildFeedLinksHook, MediaWiki\Output\Hook\AfterFinalPageOutputHook, MediaWiki\Hook\AfterImportPageHook, MediaWiki\Hook\AfterParserFetchFileAndTitleHook, MediaWiki\Hook\AlternateEditHook, MediaWiki\Hook\AlternateEditPreviewHook, MediaWiki\Hook\AlternateUserMailerHook, MediaWiki\Hook\AncientPagesQueryHook, MediaWiki\Hook\ApiBeforeMainHook, MediaWiki\Hook\ArticleMergeCompleteHook, MediaWiki\Hook\ArticleRevisionVisibilitySetHook, MediaWiki\Hook\ArticleUpdateBeforeRedirectHook, MediaWiki\Hook\BadImageHook, MediaWiki\Hook\BeforeInitializeHook, MediaWiki\Output\Hook\BeforePageDisplayHook, MediaWiki\Output\Hook\BeforePageRedirectHook, MediaWiki\Hook\BeforeParserFetchFileAndTitleHook, MediaWiki\Hook\BeforeParserFetchTemplateRevisionRecordHook, MediaWiki\Hook\BeforeWelcomeCreationHook, MediaWiki\Hook\BitmapHandlerCheckImageAreaHook, MediaWiki\Hook\BitmapHandlerTransformHook, MediaWiki\Hook\BlockIpCompleteHook, MediaWiki\Hook\BlockIpHook, MediaWiki\Hook\BookInformationHook, MediaWiki\Hook\CanonicalNamespacesHook, MediaWiki\Hook\CategoryViewer__doCategoryQueryHook, MediaWiki\Hook\CategoryViewer__generateLinkHook, MediaWiki\Hook\ChangesListInitRowsHook, MediaWiki\Hook\ChangesListInsertArticleLinkHook, MediaWiki\Hook\ChangeUserGroupsHook, MediaWiki\Hook\Collation__factoryHook, MediaWiki\Hook\ContentSecurityPolicyDefaultSourceHook, MediaWiki\Hook\ContentSecurityPolicyDirectivesHook, MediaWiki\Hook\ContentSecurityPolicyScriptSourceHook, MediaWiki\Hook\ContribsPager__getQueryInfoHook, MediaWiki\Hook\ContribsPager__reallyDoQueryHook, MediaWiki\Hook\ContributionsLineEndingHook, MediaWiki\Hook\ContributionsToolLinksHook, MediaWiki\Hook\CustomEditorHook, MediaWiki\Hook\DeletedContribsPager__reallyDoQueryHook, MediaWiki\Hook\DeletedContributionsLineEndingHook, MediaWiki\Hook\DeleteUnknownPreferencesHook, MediaWiki\Hook\EditFilterHook, MediaWiki\Hook\EditFilterMergedContentHook, MediaWiki\Hook\EditFormInitialTextHook, MediaWiki\Hook\EditFormPreloadTextHook, MediaWiki\Hook\EditPageBeforeConflictDiffHook, MediaWiki\Hook\EditPageBeforeEditButtonsHook, MediaWiki\Hook\EditPageBeforeEditToolbarHook, MediaWiki\Hook\EditPageCopyrightWarningHook, MediaWiki\Hook\EditPageGetCheckboxesDefinitionHook, MediaWiki\Hook\EditPageGetDiffContentHook, MediaWiki\Hook\EditPageGetPreviewContentHook, MediaWiki\Hook\EditPageNoSuchSectionHook, MediaWiki\Hook\EditPageTosSummaryHook, MediaWiki\Hook\EditPage__attemptSaveHook, MediaWiki\Hook\EditPage__attemptSave_afterHook, MediaWiki\Hook\EditPage__importFormDataHook, MediaWiki\Hook\EditPage__showEditForm_fieldsHook, MediaWiki\Hook\EditPage__showEditForm_initialHook, MediaWiki\Hook\EditPage__showReadOnlyForm_initialHook, MediaWiki\Hook\EditPage__showStandardInputs_optionsHook, MediaWiki\Hook\EmailUserCCHook, MediaWiki\Hook\EmailUserCompleteHook, MediaWiki\Hook\EmailUserFormHook, MediaWiki\Hook\EmailUserHook, MediaWiki\Hook\EmailUserPermissionsErrorsHook, MediaWiki\Mail\Hook\EmailUserAuthorizeSendHook, MediaWiki\Mail\Hook\EmailUserSendEmailHook, MediaWiki\Hook\EnhancedChangesListModifyBlockLineDataHook, MediaWiki\Hook\EnhancedChangesListModifyLineDataHook, MediaWiki\Hook\EnhancedChangesList__getLogTextHook, MediaWiki\Hook\ExtensionTypesHook, MediaWiki\Hook\FetchChangesListHook, MediaWiki\Hook\FileDeleteCompleteHook, MediaWiki\Hook\FileTransformedHook, MediaWiki\Hook\FileUndeleteCompleteHook, MediaWiki\Hook\FileUploadHook, MediaWiki\Hook\FormatAutocommentsHook, MediaWiki\Hook\GalleryGetModesHook, MediaWiki\Hook\GetBlockErrorMessageKeyHook, MediaWiki\Output\Hook\GetCacheVaryCookiesHook, MediaWiki\Hook\GetCanonicalURLHook, MediaWiki\Hook\GetDefaultSortkeyHook, MediaWiki\Hook\GetDoubleUnderscoreIDsHook, MediaWiki\Hook\GetExtendedMetadataHook, MediaWiki\Hook\GetFullURLHook, MediaWiki\Hook\GetHumanTimestampHook, MediaWiki\Hook\GetInternalURLHook, MediaWiki\Hook\GetIPHook, MediaWiki\Hook\GetLangPreferredVariantHook, MediaWiki\Hook\GetLinkColoursHook, MediaWiki\Hook\GetLocalURLHook, MediaWiki\Hook\GetLocalURL__ArticleHook, MediaWiki\Hook\GetLocalURL__InternalHook, MediaWiki\Hook\GetLogTypesOnUserHook, MediaWiki\Hook\GetMagicVariableIDsHook, MediaWiki\Hook\GetMetadataVersionHook, MediaWiki\Hook\GetNewMessagesAlertHook, MediaWiki\Hook\GetRelativeTimestampHook, MediaWiki\Hook\GitViewersHook, MediaWiki\Hook\HistoryPageToolLinksHook, MediaWiki\Hook\HistoryToolsHook, MediaWiki\Hook\ImageBeforeProduceHTMLHook, MediaWiki\Hook\ImgAuthBeforeStreamHook, MediaWiki\Hook\ImgAuthModifyHeadersHook, MediaWiki\Hook\ImportHandleContentXMLTagHook, MediaWiki\Hook\ImportHandleLogItemXMLTagHook, MediaWiki\Hook\ImportHandlePageXMLTagHook, MediaWiki\Hook\ImportHandleRevisionXMLTagHook, MediaWiki\Hook\ImportHandleToplevelXMLTagHook, MediaWiki\Hook\ImportHandleUnknownUserHook, MediaWiki\Hook\ImportHandleUploadXMLTagHook, MediaWiki\Hook\ImportLogInterwikiLinkHook, MediaWiki\Hook\ImportSourcesHook, MediaWiki\Hook\InfoActionHook, MediaWiki\Hook\InitializeArticleMaybeRedirectHook, MediaWiki\Hook\InternalParseBeforeLinksHook, MediaWiki\Hook\IRCLineURLHook, MediaWiki\Hook\IsTrustedProxyHook, MediaWiki\Hook\IsUploadAllowedFromUrlHook, MediaWiki\Hook\IsValidEmailAddrHook, MediaWiki\Hook\LanguageGetNamespacesHook, MediaWiki\Output\Hook\LanguageLinksHook, MediaWiki\Hook\LanguageSelectorHook, MediaWiki\Hook\LinkerMakeExternalImageHook, MediaWiki\Hook\LinkerMakeExternalLinkHook, MediaWiki\Hook\LinkerMakeMediaLinkFileHook, MediaWiki\Hook\LinksUpdateCompleteHook, MediaWiki\Hook\LinksUpdateHook, MediaWiki\Hook\LocalFilePurgeThumbnailsHook, MediaWiki\Hook\LocalFile__getHistoryHook, MediaWiki\Hook\LocalisationCacheRecacheFallbackHook, MediaWiki\Hook\LocalisationCacheRecacheHook, MediaWiki\Hook\LogEventsListGetExtraInputsHook, MediaWiki\Hook\LogEventsListLineEndingHook, MediaWiki\Hook\LogEventsListShowLogExtractHook, MediaWiki\Hook\LogExceptionHook, MediaWiki\Hook\LoginFormValidErrorMessagesHook, MediaWiki\Hook\LogLineHook, MediaWiki\Hook\LonelyPagesQueryHook, MediaWiki\Hook\MagicWordwgVariableIDsHook, MediaWiki\Hook\MaintenanceRefreshLinksInitHook, MediaWiki\Hook\MaintenanceShellStartHook, MediaWiki\Hook\MaintenanceUpdateAddParamsHook, MediaWiki\Output\Hook\MakeGlobalVariablesScriptHook, MediaWiki\Hook\ManualLogEntryBeforePublishHook, MediaWiki\Hook\MarkPatrolledCompleteHook, MediaWiki\Hook\MarkPatrolledHook, MediaWiki\Hook\MediaWikiPerformActionHook, MediaWiki\Hook\MediaWikiServicesHook, MediaWiki\Hook\MimeMagicGuessFromContentHook, MediaWiki\Hook\MimeMagicImproveFromExtensionHook, MediaWiki\Hook\MimeMagicInitHook, MediaWiki\Hook\ModifyExportQueryHook, MediaWiki\Hook\MovePageCheckPermissionsHook, MediaWiki\Hook\MovePageIsValidMoveHook, MediaWiki\Hook\NamespaceIsMovableHook, MediaWiki\Hook\NewPagesLineEndingHook, MediaWiki\Hook\OldChangesListRecentChangesLineHook, MediaWiki\Hook\OpenSearchUrlsHook, MediaWiki\Hook\OtherAutoblockLogLinkHook, MediaWiki\Hook\OtherBlockLogLinkHook, MediaWiki\Output\Hook\OutputPageAfterGetHeadLinksArrayHook, MediaWiki\Output\Hook\OutputPageBeforeHTMLHook, MediaWiki\Output\Hook\OutputPageBodyAttributesHook, MediaWiki\Output\Hook\OutputPageCheckLastModifiedHook, MediaWiki\Output\Hook\OutputPageMakeCategoryLinksHook, MediaWiki\Output\Hook\OutputPageParserOutputHook, MediaWiki\Hook\PageHistoryBeforeListHook, MediaWiki\Hook\PageHistoryLineEndingHook, MediaWiki\Hook\PageHistoryPager__doBatchLookupsHook, MediaWiki\Hook\PageHistoryPager__getQueryInfoHook, MediaWiki\Hook\PageMoveCompleteHook, MediaWiki\Hook\PageMoveCompletingHook, MediaWiki\Hook\PageRenderingHashHook, MediaWiki\Hook\ParserAfterParseHook, MediaWiki\Hook\ParserAfterTidyHook, MediaWiki\Hook\ParserBeforeInternalParseHook, MediaWiki\Hook\ParserBeforePreprocessHook, MediaWiki\Hook\ParserCacheSaveCompleteHook, MediaWiki\Hook\ParserClearStateHook, MediaWiki\Hook\ParserClonedHook, MediaWiki\Hook\ParserFetchTemplateDataHook, MediaWiki\Hook\ParserFirstCallInitHook, MediaWiki\Hook\ParserGetVariableValueSwitchHook, MediaWiki\Hook\ParserGetVariableValueTsHook, MediaWiki\Hook\ParserLimitReportFormatHook, MediaWiki\Hook\ParserLimitReportPrepareHook, MediaWiki\Hook\ParserLogLinterDataHook, MediaWiki\Hook\ParserMakeImageParamsHook, MediaWiki\Hook\ParserModifyImageHTMLHook, MediaWiki\Hook\ParserOptionsRegisterHook, MediaWiki\Hook\ParserOutputPostCacheTransformHook, MediaWiki\Hook\ParserPreSaveTransformCompleteHook, MediaWiki\Hook\ParserTestGlobalsHook, MediaWiki\Hook\PasswordPoliciesForUserHook, MediaWiki\Hook\PostLoginRedirectHook, MediaWiki\Hook\PreferencesGetIconHook, MediaWiki\Hook\PreferencesGetLayoutHook, MediaWiki\Hook\PreferencesGetLegendHook, MediaWiki\Hook\PrefsEmailAuditHook, MediaWiki\Hook\ProtectionForm__buildFormHook, MediaWiki\Hook\ProtectionForm__saveHook, MediaWiki\Hook\ProtectionForm__showLogExtractHook, MediaWiki\Hook\ProtectionFormAddFormFieldsHook, MediaWiki\Hook\RandomPageQueryHook, MediaWiki\Hook\RawPageViewBeforeOutputHook, MediaWiki\Hook\RecentChangesPurgeRowsHook, MediaWiki\Hook\RecentChange_saveHook, MediaWiki\Hook\RejectParserCacheValueHook, MediaWiki\Hook\RequestContextCreateSkinHook, MediaWiki\Hook\SelfLinkBeginHook, MediaWiki\Hook\SendWatchlistEmailNotificationHook, MediaWiki\Hook\SetupAfterCacheHook, MediaWiki\Hook\ShortPagesQueryHook, MediaWiki\Hook\SidebarBeforeOutputHook, MediaWiki\Hook\SiteNoticeAfterHook, MediaWiki\Hook\SiteNoticeBeforeHook, MediaWiki\Hook\SkinAddFooterLinksHook, MediaWiki\Hook\SkinAfterBottomScriptsHook, MediaWiki\Hook\SkinAfterContentHook, MediaWiki\Hook\SkinBuildSidebarHook, MediaWiki\Hook\SkinCopyrightFooterHook, MediaWiki\Hook\SkinEditSectionLinksHook, MediaWiki\Hook\SkinPreloadExistenceHook, MediaWiki\Hook\SkinSubPageSubtitleHook, MediaWiki\Hook\SkinTemplateGetLanguageLinkHook, MediaWiki\Hook\SkinTemplateNavigation__UniversalHook, MediaWiki\Hook\SoftwareInfoHook, MediaWiki\Hook\SpecialBlockModifyFormFieldsHook, MediaWiki\Hook\SpecialContributionsBeforeMainOutputHook, MediaWiki\Hook\SpecialContributions__formatRow__flagsHook, MediaWiki\Hook\SpecialCreateAccountBenefitsHook, MediaWiki\Hook\SpecialExportGetExtraPagesHook, MediaWiki\Hook\SpecialContributions__getForm__filtersHook, MediaWiki\Hook\SpecialListusersDefaultQueryHook, MediaWiki\Hook\SpecialListusersFormatRowHook, MediaWiki\Hook\SpecialListusersHeaderFormHook, MediaWiki\Hook\SpecialListusersHeaderHook, MediaWiki\Hook\SpecialListusersQueryInfoHook, MediaWiki\Hook\SpecialLogAddLogSearchRelationsHook, MediaWiki\Hook\SpecialMovepageAfterMoveHook, MediaWiki\Hook\SpecialMuteModifyFormFieldsHook, MediaWiki\Hook\SpecialNewpagesConditionsHook, MediaWiki\Hook\SpecialNewPagesFiltersHook, MediaWiki\Hook\SpecialPrefixIndexGetFormFiltersHook, MediaWiki\Hook\SpecialPrefixIndexQueryHook, MediaWiki\Hook\SpecialRandomGetRandomTitleHook, MediaWiki\Hook\SpecialRecentChangesPanelHook, MediaWiki\Hook\SpecialResetTokensTokensHook, MediaWiki\Hook\SpecialSearchCreateLinkHook, MediaWiki\Hook\SpecialSearchGoResultHook, MediaWiki\Hook\SpecialSearchNogomatchHook, MediaWiki\Hook\SpecialSearchProfilesHook, MediaWiki\Hook\SpecialSearchResultsAppendHook, MediaWiki\Hook\SpecialSearchResultsHook, MediaWiki\Hook\SpecialSearchResultsPrependHook, MediaWiki\Hook\SpecialSearchSetupEngineHook, MediaWiki\Hook\SpecialStatsAddExtraHook, MediaWiki\Hook\SpecialTrackingCategories__generateCatLinkHook, MediaWiki\Hook\SpecialTrackingCategories__preprocessHook, MediaWiki\Hook\SpecialUploadCompleteHook, MediaWiki\Hook\SpecialVersionVersionUrlHook, MediaWiki\Hook\SpecialWatchlistGetNonRevisionTypesHook, MediaWiki\Hook\TestCanonicalRedirectHook, MediaWiki\Hook\ThumbnailBeforeProduceHTMLHook, MediaWiki\Hook\TempUserCreatedRedirectHook, MediaWiki\Hook\TitleExistsHook, MediaWiki\Hook\TitleGetEditNoticesHook, MediaWiki\Hook\TitleGetRestrictionTypesHook, MediaWiki\Hook\TitleIsAlwaysKnownHook, MediaWiki\Hook\TitleIsMovableHook, MediaWiki\Hook\TitleMoveHook, MediaWiki\Hook\TitleMoveStartingHook, MediaWiki\Hook\UnblockUserCompleteHook, MediaWiki\Hook\UnblockUserHook, MediaWiki\Hook\UndeleteForm__showHistoryHook, MediaWiki\Hook\UndeleteForm__showRevisionHook, MediaWiki\Hook\UndeletePageToolLinksHook, MediaWiki\Hook\UnitTestsAfterDatabaseSetupHook, MediaWiki\Hook\UnitTestsBeforeDatabaseTeardownHook, MediaWiki\Hook\UnitTestsListHook, MediaWiki\Hook\UnwatchArticleCompleteHook, MediaWiki\Hook\UnwatchArticleHook, MediaWiki\Hook\UpdateUserMailerFormattedPageStatusHook, MediaWiki\Hook\UploadCompleteHook, MediaWiki\Hook\UploadCreateFromRequestHook, MediaWiki\Hook\UploadFormInitDescriptorHook, MediaWiki\Hook\UploadFormSourceDescriptorsHook, MediaWiki\Hook\UploadForm_BeforeProcessingHook, MediaWiki\Hook\UploadForm_getInitialPageTextHook, MediaWiki\Hook\UploadForm_initialHook, MediaWiki\Hook\UploadStashFileHook, MediaWiki\Hook\UploadVerifyFileHook, MediaWiki\Hook\UploadVerifyUploadHook, MediaWiki\Hook\UserEditCountUpdateHook, MediaWiki\Hook\UserGetLanguageObjectHook, MediaWiki\Hook\UserLoginCompleteHook, MediaWiki\Hook\UserLogoutCompleteHook, MediaWiki\Hook\UserMailerChangeReturnPathHook, MediaWiki\Hook\UserMailerSplitToHook, MediaWiki\Hook\UserMailerTransformContentHook, MediaWiki\Hook\UserMailerTransformMessageHook, MediaWiki\Hook\UsersPagerDoBatchLookupsHook, MediaWiki\Hook\UserToolLinksEditHook, MediaWiki\Hook\ValidateExtendedMetadataCacheHook, MediaWiki\Hook\WantedPages__getQueryInfoHook, MediaWiki\Hook\WatchArticleCompleteHook, MediaWiki\Hook\WatchArticleHook, MediaWiki\Hook\WatchedItemQueryServiceExtensionsHook, MediaWiki\Hook\WatchlistEditorBeforeFormRenderHook, MediaWiki\Hook\WatchlistEditorBuildRemoveLineHook, MediaWiki\Hook\WebRequestPathInfoRouterHook, MediaWiki\Hook\WebResponseSetCookieHook, MediaWiki\Hook\WhatLinksHerePropsHook, MediaWiki\Hook\WikiExporter__dumpStableQueryHook, MediaWiki\Hook\XmlDumpWriterOpenPageHook, MediaWiki\Hook\XmlDumpWriterWriteRevisionHook, MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook, MediaWiki\Interwiki\Hook\InterwikiLoadPrefixHook, MediaWiki\Languages\Hook\LanguageGetTranslatedLanguageNamesHook, MediaWiki\Languages\Hook\Language__getMessagesFileNameHook, MediaWiki\Linker\Hook\LinkerGenerateRollbackLinkHook, MediaWiki\Linker\Hook\HtmlPageLinkRendererBeginHook, MediaWiki\Linker\Hook\HtmlPageLinkRendererEndHook, MediaWiki\Page\Hook\ArticleConfirmDeleteHook, MediaWiki\Page\Hook\ArticleDeleteAfterSuccessHook, MediaWiki\Page\Hook\ArticleDeleteCompleteHook, MediaWiki\Page\Hook\ArticleDeleteHook, MediaWiki\Page\Hook\ArticleFromTitleHook, MediaWiki\Page\Hook\ArticlePageDataAfterHook, MediaWiki\Page\Hook\ArticlePageDataBeforeHook, MediaWiki\Page\Hook\ArticleParserOptionsHook, MediaWiki\Page\Hook\ArticleProtectCompleteHook, MediaWiki\Page\Hook\ArticleProtectHook, MediaWiki\Page\Hook\ArticlePurgeHook, MediaWiki\Page\Hook\ArticleRevisionViewCustomHook, MediaWiki\Page\Hook\ArticleShowPatrolFooterHook, MediaWiki\Page\Hook\ArticleUndeleteHook, MediaWiki\Page\Hook\ArticleViewFooterHook, MediaWiki\Page\Hook\ArticleViewHeaderHook, MediaWiki\Page\Hook\ArticleViewRedirectHook, MediaWiki\Page\Hook\Article__MissingArticleConditionsHook, MediaWiki\Page\Hook\BeforeDisplayNoArticleTextHook, MediaWiki\Page\Hook\CategoryAfterPageAddedHook, MediaWiki\Page\Hook\CategoryAfterPageRemovedHook, MediaWiki\Page\Hook\CategoryPageViewHook, MediaWiki\Page\Hook\DisplayOldSubtitleHook, MediaWiki\Page\Hook\ImageOpenShowImageInlineBeforeHook, MediaWiki\Page\Hook\ImagePageAfterImageLinksHook, MediaWiki\Page\Hook\ImagePageFileHistoryLineHook, MediaWiki\Page\Hook\ImagePageFindFileHook, MediaWiki\Page\Hook\ImagePageShowTOCHook, MediaWiki\Page\Hook\IsFileCacheableHook, MediaWiki\Page\Hook\OpportunisticLinksUpdateHook, MediaWiki\Page\Hook\PageDeleteCompleteHook, MediaWiki\Page\Hook\PageDeleteHook, MediaWiki\Page\Hook\PageDeletionDataUpdatesHook, MediaWiki\Page\Hook\PageUndeleteCompleteHook, MediaWiki\Page\Hook\PageUndeleteHook, MediaWiki\Page\Hook\PageViewUpdatesHook, MediaWiki\Page\Hook\RevisionFromEditCompleteHook, MediaWiki\Page\Hook\RevisionUndeletedHook, MediaWiki\Page\Hook\RollbackCompleteHook, MediaWiki\Page\Hook\ShowMissingArticleHook, MediaWiki\Page\Hook\WikiPageDeletionUpdatesHook, MediaWiki\Page\Hook\WikiPageFactoryHook, MediaWiki\Permissions\Hook\PermissionErrorAuditHook, MediaWiki\Permissions\Hook\GetUserPermissionsErrorsExpensiveHook, MediaWiki\Permissions\Hook\GetUserPermissionsErrorsHook, MediaWiki\Permissions\Hook\TitleQuickPermissionsHook, MediaWiki\Permissions\Hook\TitleReadWhitelistHook, MediaWiki\Permissions\Hook\UserCanHook, MediaWiki\Permissions\Hook\UserGetAllRightsHook, MediaWiki\Permissions\Hook\UserGetRightsHook, MediaWiki\Permissions\Hook\UserGetRightsRemoveHook, MediaWiki\Permissions\Hook\UserIsBlockedFromHook, MediaWiki\Permissions\Hook\UserIsEveryoneAllowedHook, MediaWiki\Preferences\Hook\GetPreferencesHook, MediaWiki\Preferences\Hook\PreferencesFormPreSaveHook, MediaWiki\RenameUser\Hook\RenameUserAbortHook, MediaWiki\RenameUser\Hook\RenameUserCompleteHook, MediaWiki\RenameUser\Hook\RenameUserPreRenameHook, MediaWiki\RenameUser\Hook\RenameUserSQLHook, MediaWiki\RenameUser\Hook\RenameUserWarningHook, MediaWiki\Rest\Hook\SearchResultProvideDescriptionHook, MediaWiki\Revision\Hook\ContentHandlerDefaultModelForHook, MediaWiki\Revision\Hook\RevisionRecordInsertedHook, MediaWiki\Search\Hook\PrefixSearchBackendHook, MediaWiki\Search\Hook\PrefixSearchExtractNamespaceHook, MediaWiki\Search\Hook\SearchableNamespacesHook, MediaWiki\Search\Hook\SearchAfterNoDirectMatchHook, MediaWiki\Search\Hook\SearchGetNearMatchBeforeHook, MediaWiki\Search\Hook\SearchGetNearMatchCompleteHook, MediaWiki\Search\Hook\SearchGetNearMatchHook, MediaWiki\Search\Hook\SearchIndexFieldsHook, MediaWiki\Search\Hook\SearchResultInitFromTitleHook, MediaWiki\Search\Hook\SearchResultProvideThumbnailHook, MediaWiki\Search\Hook\SearchResultsAugmentHook, MediaWiki\Search\Hook\ShowSearchHitHook, MediaWiki\Search\Hook\ShowSearchHitTitleHook, MediaWiki\Search\Hook\SpecialSearchPowerBoxHook, MediaWiki\Search\Hook\SpecialSearchProfileFormHook, MediaWiki\Session\Hook\SessionCheckInfoHook, MediaWiki\Session\Hook\SessionMetadataHook, MediaWiki\Shell\Hook\WfShellWikiCmdHook, MediaWiki\Skins\Hook\SkinAfterPortletHook, MediaWiki\Skins\Hook\SkinPageReadyConfigHook, MediaWiki\SpecialPage\Hook\AuthChangeFormFieldsHook, MediaWiki\SpecialPage\Hook\ChangeAuthenticationDataAuditHook, MediaWiki\SpecialPage\Hook\ChangesListSpecialPageQueryHook, MediaWiki\SpecialPage\Hook\ChangesListSpecialPageStructuredFiltersHook, MediaWiki\SpecialPage\Hook\RedirectSpecialArticleRedirectParamsHook, MediaWiki\SpecialPage\Hook\SpecialPageAfterExecuteHook, MediaWiki\SpecialPage\Hook\SpecialPageBeforeExecuteHook, MediaWiki\SpecialPage\Hook\SpecialPageBeforeFormDisplayHook, MediaWiki\SpecialPage\Hook\SpecialPage_initListHook, MediaWiki\SpecialPage\Hook\WgQueryPagesHook, MediaWiki\Storage\Hook\ArticleEditUpdateNewTalkHook, MediaWiki\Storage\Hook\ArticlePrepareTextForEditHook, MediaWiki\Storage\Hook\BeforeRevertedTagUpdateHook, MediaWiki\Storage\Hook\MultiContentSaveHook, MediaWiki\Storage\Hook\PageContentSaveHook, MediaWiki\Storage\Hook\PageSaveCompleteHook, MediaWiki\Storage\Hook\ParserOutputStashForEditHook, MediaWiki\Storage\Hook\RevisionDataUpdatesHook, MediaWiki\User\Hook\AutopromoteConditionHook, MediaWiki\User\Hook\ConfirmEmailCompleteHook, MediaWiki\User\Hook\EmailConfirmedHook, MediaWiki\User\Hook\GetAutoPromoteGroupsHook, MediaWiki\User\Hook\InvalidateEmailCompleteHook, MediaWiki\User\Hook\IsValidPasswordHook, MediaWiki\User\Hook\PingLimiterHook, MediaWiki\User\Hook\SpecialPasswordResetOnSubmitHook, MediaWiki\User\Hook\UserAddGroupHook, MediaWiki\User\Hook\UserArrayFromResultHook, MediaWiki\User\Hook\UserCanSendEmailHook, MediaWiki\User\Hook\UserClearNewTalkNotificationHook, MediaWiki\User\Hook\UserEffectiveGroupsHook, MediaWiki\User\Hook\UserGetDefaultOptionsHook, MediaWiki\User\Hook\UserGetEmailAuthenticationTimestampHook, MediaWiki\User\Hook\UserGetEmailHook, MediaWiki\User\Hook\UserGetReservedNamesHook, MediaWiki\User\Hook\UserGroupsChangedHook, MediaWiki\User\Hook\UserIsBlockedGloballyHook, MediaWiki\User\Hook\UserIsBotHook, MediaWiki\User\Hook\UserIsLockedHook, MediaWiki\User\Hook\UserLoadAfterLoadFromSessionHook, MediaWiki\User\Hook\UserLoadDefaultsHook, MediaWiki\User\Hook\UserLogoutHook, MediaWiki\User\Hook\UserPrivilegedGroupsHook, MediaWiki\User\Hook\UserRemoveGroupHook, MediaWiki\User\Hook\UserSaveSettingsHook, MediaWiki\User\Hook\UserSendConfirmationMailHook, MediaWiki\User\Hook\UserSetEmailAuthenticationTimestampHook, MediaWiki\User\Hook\UserSetEmailHook, MediaWiki\User\Hook\User__mailPasswordInternalHook, MediaWiki\User\Options\Hook\LoadUserOptionsHook, and MediaWiki\User\Options\Hook\SaveUserOptionsHook.

Public Member Functions

 __construct (HookContainer $container)
 
 onAbortAutoblock ( $autoblockip, $block)
 Use this hook to cancel an autoblock.
 
 onAbortDiffCache ( $diffEngine)
 Use this hook to cancel the caching of a diff.
 
 onAbortEmailNotification ( $editor, $title, $rc)
 Use this hook to cancel email notifications for an edit.
 
 onAbortTalkPageEmailNotification ( $targetUser, $title)
 Use this hook to disable email notifications of edits to users' talk pages.
 
 onActionBeforeFormDisplay ( $name, $form, $article)
 This hook is called before executing the HTMLForm object.
 
 onActionModifyFormFields ( $name, &$fields, $article)
 This hook is called before creating an HTMLForm object for a page action.
 
 onAddNewAccount ( $user, $byEmail)
 This hook is called after a user account is created.
 
 onAfterBuildFeedLinks (&$feedLinks)
 This hook is called in OutputPage.php after all feed links (atom, rss,...) are created.
 
 onAfterFinalPageOutput ( $output)
 This hook is called nearly at the end of OutputPage::output() but before OutputPage::sendCacheControl() and final ob_end_flush() which will send the buffered output to the client.
 
 onAfterImportPage ( $title, $foreignTitle, $revCount, $sRevCount, $pageInfo)
 This hook is called when a page import is completed.
 
 onAfterParserFetchFileAndTitle ( $parser, $ig, &$html)
 This hook is called after an image gallery is formed by Parser, just before adding its HTML to parser output.
 
 onAlternateEdit ( $editPage)
 This hook is called before checking if a user can edit a page and before showing the edit form ( EditPage::edit() ).
 
 onAlternateEditPreview ( $editPage, &$content, &$previewHTML, &$parserOutput)
 This hook is called before generating the preview of the page when editing ( EditPage::getPreviewText() ).
 
 onAlternateUserMailer ( $headers, $to, $from, $subject, $body)
 This hook is called before mail is sent so that mail could be logged (or something else) instead of using PEAR or PHP's mail().
 
 onAncientPagesQuery (&$tables, &$conds, &$joinConds)
 Use this hook to modify the query used by Special:AncientPages.
 
 onApiBeforeMain (&$main)
 This hook is called before calling ApiMain's execute() method in api.php.
 
 onArticle__MissingArticleConditions (&$conds, $logTypes)
 This hook is called before fetching deletion and move log entries to display a message of a non-existing page being deleted/moved.
 
 onArticleConfirmDelete ( $article, $output, &$reason)
 This hook is called before writing the confirmation form for article deletion.
 
 onArticleContentOnDiff ( $diffEngine, $output)
 This hook is called before showing the article content below a diff.
 
 onArticleDelete ( $wikiPage, $user, &$reason, &$error, &$status, $suppress)
 
 onArticleDeleteAfterSuccess ( $title, $outputPage)
 Use this hook to modify the output after an article has been deleted.
 
 onArticleDeleteComplete ( $wikiPage, $user, $reason, $id, $content, $logEntry, $archivedRevisionCount)
 This hook is called after an article is deleted.
 
 onArticleEditUpdateNewTalk ( $wikiPage, $recipient)
 This hook is called before updating user_newtalk when a user talk page was changed.
 
 onArticleFromTitle ( $title, &$article, $context)
 This hook is called when creating an article object from a title object using Wiki::articleFromTitle().
 
 onArticleMergeComplete ( $targetTitle, $destTitle)
 This hook is called after merging to article using Special:Mergehistory.
 
 onArticlePageDataAfter ( $wikiPage, &$row)
 This hook is called after loading data of an article from the database.
 
 onArticlePageDataBefore ( $wikiPage, &$fields, &$tables, &$joinConds)
 This hook is called before loading data of an article from the database.
 
 onArticleParserOptions (Article $article, ParserOptions $popts)
 This hook is called before parsing wikitext for an article, and allows setting particular parser options based on title, user preferences, etc.
 
 onArticlePrepareTextForEdit ( $wikiPage, $popts)
 This hook is called when preparing text to be saved.
 
 onArticleProtect ( $wikiPage, $user, $protect, $reason)
 This hook is called before an article is protected.
 
 onArticleProtectComplete ( $wikiPage, $user, $protect, $reason)
 This hook is called after an article is protected.
 
 onArticlePurge ( $wikiPage)
 This hook is called before executing "&action=purge".
 
 onArticleRevisionViewCustom ( $revision, $title, $oldid, $output)
 Use this hook for custom rendering of an article's content.
 
 onArticleRevisionVisibilitySet ( $title, $ids, $visibilityChangeMap)
 This hook is called when changing visibility of one or more revisions of an article.
 
 onArticleShowPatrolFooter ( $article)
 This hook is called at the beginning of Article::showPatrolFooter.
 
 onArticleUndelete ( $title, $create, $comment, $oldPageId, $restoredPages)
 This hook is called when one or more revisions of an article are restored.
 
 onArticleUpdateBeforeRedirect ( $article, &$sectionanchor, &$extraq)
 This hook is called after a page is updated (usually on save), before the user is redirected back to the page.
 
 onArticleViewFooter ( $article, $patrolFooterShown)
 This hook is called after showing the footer section of an ordinary page view.
 
 onArticleViewHeader ( $article, &$outputDone, &$pcache)
 Use this hook to control article output.
 
 onArticleViewRedirect ( $article)
 This hook is called before setting "Redirected from ..." subtitle when a redirect was followed.
 
 onAuthChangeFormFields ( $requests, $fieldInfo, &$formDescriptor, $action)
 This hook is called after converting a field information array obtained from a set of AuthenticationRequest classes into a form descriptor; hooks can tweak the array to change how login etc.
 
 onAuthManagerLoginAuthenticateAudit ( $response, $user, $username, $extraData)
 This hook is called when a login attempt either succeeds or fails for a reason other than misconfiguration or session loss.
 
 onAutopromoteCondition ( $type, $args, $user, &$result)
 Use this hook to check autopromote condition for user.
 
 onBacklinkCacheGetConditions ( $table, $title, &$conds)
 Use this hook to set conditions for query when links to certain title are fetched.
 
 onBacklinkCacheGetPrefix ( $table, &$prefix)
 Use this hook to set a prefix for a specific link table.
 
 onBadImage ( $name, &$bad)
 This hook is called when checking against the bad image list.
 
 onBeforeDisplayNoArticleText ( $article)
 This hook is called before displaying message key "noarticletext" or "noarticletext-nopermission" at Article::showMissingArticle().
 
 onBeforeInitialize ( $title, $unused, $output, $user, $request, $mediaWiki)
 This hook is called before anything is initialized in ActionEntryPoint::performRequest().
 
 onBeforePageDisplay ( $out, $skin)
 This hook is called prior to outputting a page.
 
 onBeforePageRedirect ( $out, &$redirect, &$code)
 This hook is called prior to sending an HTTP redirect.
 
 onBeforeParserFetchFileAndTitle ( $parser, $nt, &$options, &$descQuery)
 This hook is called before an image is rendered by Parser.
 
 onBeforeParserFetchTemplateRevisionRecord (?LinkTarget $contextTitle, LinkTarget $title, bool &$skip, ?RevisionRecord &$revRecord)
 This hook is called before a template is fetched by Parser.
 
 onBeforeRevertedTagUpdate ( $wikiPage, $user, $summary, $flags, $revisionRecord, $editResult, &$approved)
 This hook is called before scheduling a RevertedTagUpdateJob.
 
 onBeforeWelcomeCreation (&$welcome_creation_msg, &$injected_html)
 This hook is called before the welcomecreation message is displayed to a newly created user.
 
 onBitmapHandlerCheckImageArea ( $image, &$params, &$checkImageAreaHookResult)
 This hook is called by BitmapHandler::normaliseParams, after all normalizations have been performed, except for the $wgMaxImageArea check.
 
 onBitmapHandlerTransform ( $handler, $image, &$scalerParams, &$mto)
 This hook is called before a file is transformed, giving extensions the possibility to transform it themselves.
 
 onBlockIp ( $block, $user, &$reason)
 This hook is called before an IP address or user is blocked.
 
 onBlockIpComplete ( $block, $user, $priorBlock)
 This hook is called after an IP address or user is blocked.
 
 onBookInformation ( $isbn, $output)
 This hook is called before information output on Special:Booksources.
 
 onCanonicalNamespaces (&$namespaces)
 Use this hook to add namespaces or alter the defaults.
 
 onCategoryAfterPageAdded ( $category, $wikiPage)
 This hook is called after a page is added to a category.
 
 onCategoryAfterPageRemoved ( $category, $wikiPage, $id)
 This hook is called after a page is removed from a category.
 
 onCategoryPageView ( $catpage)
 This hook is called before viewing a categorypage in CategoryPage::view.
 
 onCategoryViewer__doCategoryQuery ( $type, $res)
 This hook is called after querying for pages to be displayed in a Category page.
 
 onCategoryViewer__generateLink ( $type, $title, $html, &$link)
 This hook is called before generating an output link allow extensions opportunity to generate a more specific or relevant link.
 
 onChangeAuthenticationDataAudit ( $req, $status)
 This hook is called when a user changes their password.
 
 onChangesListInitRows ( $changesList, $rows)
 Use this hook to batch process change list rows prior to rendering.
 
 onChangesListInsertArticleLink ( $changesList, &$articlelink, &$s, $rc, $unpatrolled, $watched)
 Use this hook to override or augment link to article in RC list.
 
 onChangesListSpecialPageQuery ( $name, &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts)
 This hook is called when building an SQL query on pages inheriting from ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked and Watchlist).
 
 onChangesListSpecialPageStructuredFilters ( $special)
 Use this hook to register filters for pages inheriting from ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked, and Watchlist).
 
 onChangeTagAfterDelete ( $tag, &$status)
 This hook is called after a change tag has been deleted (that is, removed from all revisions and log entries to which it was applied).
 
 onChangeTagCanCreate ( $tag, $user, &$status)
 Use this hook to tell whether a change tag should be able to be created from the UI (Special:Tags) or via the API.
 
 onChangeTagCanDelete ( $tag, $user, &$status)
 Use this hook to tell whether a change tag should be able to be deleted from the UI (Special:Tags) or via the API.
 
 onChangeTagsAfterUpdateTags ( $addedTags, $removedTags, $prevTags, $rc_id, $rev_id, $log_id, $params, $rc, $user)
 This hook is called after tags have been updated with the ChangeTags::updateTags function.
 
 onChangeTagsAllowedAdd (&$allowedTags, $addTags, $user)
 This hook is called when checking if a user can add tags to a change.
 
 onChangeTagsListActive (&$tags)
 Use this hook to nominate which of the tags your extension uses are in active use.
 
 onChangeUserGroups ( $performer, $user, &$add, &$remove)
 This hook is called before user groups are changed.
 
 onCollation__factory ( $collationName, &$collationObject)
 This hook is called if $wgCategoryCollation is an unknown collation.
 
 onConfirmEmailComplete ( $user)
 This hook is called after a user's email has been confirmed successfully.
 
 onContentAlterParserOutput ( $content, $title, $parserOutput)
 Use this hook to modify parser output for a given content object.
 
 onContentGetParserOutput ( $content, $title, $revId, $options, $generateHtml, &$parserOutput)
 Use this hook to customize parser output for a given content object.
 
 onContentHandlerDefaultModelFor ( $title, &$model)
 This hook is called when the default content model is determined for a given title.
 
 onContentHandlerForModelID ( $modelName, &$handler)
 This hook is called when a ContentHandler is requested for a given content model name, but no entry for that model exists in $wgContentHandlers.
 
 onContentModelCanBeUsedOn ( $contentModel, $title, &$ok)
 Use this hook to determine whether a content model can be used on a given page.
 
 onContentSecurityPolicyDefaultSource (&$defaultSrc, $policyConfig, $mode)
 Use this hook to modify the allowed CSP load sources.
 
 onContentSecurityPolicyDirectives (&$directives, $policyConfig, $mode)
 If ContentSecurityPolicyDefaultSource and ContentSecurityPolicyScriptSource do not meet your needs, use this hook to modify the content security policy directives.
 
 onContentSecurityPolicyScriptSource (&$scriptSrc, $policyConfig, $mode)
 Use this hook to modify the allowed CSP script sources.
 
 onContribsPager__getQueryInfo ( $pager, &$queryInfo)
 This hook is called before the contributions query is about to run.
 
 onContribsPager__reallyDoQuery (&$data, $pager, $offset, $limit, $descending)
 This hook is called before really executing the query for My Contributions.
 
 onContributeCards (&$cards)
 
 onContributionsLineEnding ( $page, &$ret, $row, &$classes, &$attribs)
 This hook is called before a contributions HTML line is finished.
 
 onContributionsToolLinks ( $id, Title $title, array &$tools, SpecialPage $specialPage)
 Use this hook to change the tool links above Special:Contributions.
 
 onConvertContent ( $content, $toModel, $lossy, &$result)
 This hook is called by AbstractContent::convert when a conversion to another content model is requested.
 
 onCustomEditor ( $article, $user)
 This hook is called when invoking the page editor.
 
 onDeletedContribsPager__reallyDoQuery (&$data, $pager, $offset, $limit, $descending)
 This hook is called before really executing the query for Special:DeletedContributions.
 
 onDeletedContributionsLineEnding ( $page, &$ret, $row, &$classes, &$attribs)
 This hook is called before a DeletedContributions HTML line is finished.
 
 onDeleteUnknownPreferences (&$where, $db)
 This hook is called by the cleanupPreferences.php maintenance script to build a WHERE clause with which to delete preferences that are not known about.
 
 onDifferenceEngineAfterLoadNewText ( $differenceEngine)
 This hook is called in DifferenceEngine::loadNewText() after the new revision's content has been loaded into the class member variable $differenceEngine->mNewContent but before returning true from this function.
 
 onDifferenceEngineLoadTextAfterNewContentIsLoaded ( $differenceEngine)
 This hook is called in DifferenceEngine::loadText() after the new revision's content has been loaded into the class member variable $differenceEngine->mNewContent but before checking if the variable's value is null.
 
 onDifferenceEngineMarkPatrolledLink ( $differenceEngine, &$markAsPatrolledLink, $rcid)
 Use this hook to change the "mark as patrolled" link which is shown both on the diff header as well as on the bottom of a page, usually wrapped in a span element which has class="patrollink".
 
 onDifferenceEngineMarkPatrolledRCID (&$rcid, $differenceEngine, $change, $user)
 Use this hook to possibly change the rcid parameter.
 
 onDifferenceEngineNewHeader ( $differenceEngine, &$newHeader, $formattedRevisionTools, $nextlink, $rollback, $newminor, $diffOnly, $rdel, $unhide)
 Use this hook to change the $newHeader variable, which contains information about the new revision, such as the revision's author, whether the revision was marked as a minor edit or not, etc.
 
 onDifferenceEngineOldHeader ( $differenceEngine, &$oldHeader, $prevlink, $oldminor, $diffOnly, $ldel, $unhide)
 Use this hook to change the $oldHeader variable, which contains information about the old revision, such as the revision's author, whether the revision was marked as a minor edit or not, etc.
 
 onDifferenceEngineOldHeaderNoOldRev (&$oldHeader)
 Use this hook to change the $oldHeader variable in cases when there is no old revision.
 
 onDifferenceEngineRenderRevisionAddParserOutput ( $differenceEngine, $out, $parserOutput, $wikiPage)
 Use this hook to change the parser output.
 
 onDifferenceEngineRenderRevisionShowFinalPatrolLink ()
 Use this hook to not show the final "mark as patrolled" link on the bottom of a page.
 
 onDifferenceEngineShowDiff ( $differenceEngine)
 Use this hook to affect the diff text which eventually gets sent to the OutputPage object.
 
 onDifferenceEngineShowDiffPage ( $out)
 Use this hook to add additional output via the available OutputPage object into the diff view.
 
 onDifferenceEngineShowDiffPageMaybeShowMissingRevision ( $differenceEngine)
 This hook is called in DifferenceEngine::showDiffPage() when revision data cannot be loaded.
 
 onDifferenceEngineShowEmptyOldContent ( $differenceEngine)
 Use this hook to change the diff table body (without header) in cases when there is no old revision or the old and new revisions are identical.
 
 onDifferenceEngineViewHeader ( $differenceEngine)
 This hook is called before diff display.
 
 onDiffTools ( $newRevRecord, &$links, $oldRevRecord, $userIdentity)
 Use this hook to override or extend the revision tools available from the diff view, i.e.
 
 onDisplayOldSubtitle ( $article, &$oldid)
 This hook is called before creating subtitle when browsing old versions of an article.
 
 onEditFilter ( $editor, $text, $section, &$error, $summary)
 Use this hook to perform checks on an edit.
 
 onEditFilterMergedContent ( $context, $content, $status, $summary, $user, $minoredit)
 
 onEditFormInitialText ( $editPage)
 Use this hook to modify the edit form when editing existing pages.
 
 onEditFormPreloadText (&$text, $title)
 Use this hook to populate the edit form when creating pages.
 
 onEditPage__attemptSave ( $editpage_Obj)
 This hook is called before an article is saved, before WikiPage::doUserEditContent() is called.
 
 onEditPage__attemptSave_after ( $editpage_Obj, $status, $resultDetails)
 This hook is called after an article save attempt.
 
 onEditPage__importFormData ( $editpage, $request)
 Use this hook to read additional data posted in the form.
 
 onEditPage__showEditForm_fields ( $editor, $out)
 Use this hook to inject form field into edit form.
 
 onEditPage__showEditForm_initial ( $editor, $out)
 This hook is called before showing the edit form.
 
 onEditPage__showReadOnlyForm_initial ( $editor, $out)
 This hook is similar to EditPage::showEditForm:initial but for the read-only 'view source' variant of the edit form.
 
 onEditPage__showStandardInputs_options ( $editor, $out, &$tabindex)
 Use this hook to inject form fields into the editOptions area.
 
 onEditPageBeforeConflictDiff ( $editor, $out)
 Use this hook to modify the EditPage object and output when there's an edit conflict.
 
 onEditPageBeforeEditButtons ( $editpage, &$buttons, &$tabindex)
 Use this hook to modify the edit buttons below the textarea in the edit form.
 
 onEditPageBeforeEditToolbar (&$toolbar)
 Use this hook to add an edit toolbar above the textarea in the edit form.
 
 onEditPageCopyrightWarning ( $title, &$msg)
 Use this hook for site and per-namespace customization of contribution/copyright notice.
 
 onEditPageGetCheckboxesDefinition ( $editpage, &$checkboxes)
 Use this hook to modify the edit checkboxes and other form fields below the textarea in the edit form.
 
 onEditPageGetDiffContent ( $editPage, &$newtext)
 Use this hook to modify the wikitext that will be used in "Show changes".
 
 onEditPageGetPreviewContent ( $editPage, &$content)
 Use this hook to modify the wikitext that will be previewed.
 
 onEditPageNoSuchSection ( $editpage, &$res)
 This hook is called when a section edit request is given for a non-existent section.
 
 onEditPageTosSummary ( $title, &$msg)
 Use this hook for site and per-namespace customizations of terms of service summary link that might exist separately from the copyright notice.
 
 onEmailConfirmed ( $user, &$confirmed)
 This hook is called when checking that the user's email address is "confirmed".
 
 onEmailUser (&$to, &$from, &$subject, &$text, &$error)
 This hook is called before sending email from one user to another.
 
 onEmailUserAuthorizeSend (Authority $sender, StatusValue $status)
 This hook is called when checking whether a user is allowed to send emails.
 
 onEmailUserCC (&$to, &$from, &$subject, &$text)
 This hook is called before sending the copy of the email to the author.
 
 onEmailUserComplete ( $to, $from, $subject, $text)
 This hook is called after sending email from one user to another.
 
 onEmailUserForm (&$form)
 This hook is called after building the email user form object.
 
 onEmailUserPermissionsErrors ( $user, $editToken, &$hookErr)
 Use this hook to retrieve permissions errors for emailing a user.
 
 onEmailUserSendEmail (Authority $from, MailAddress $fromAddress, UserEmailContact $to, MailAddress $toAddress, string $subject, string $text, StatusValue $status)
 This hook is called before sending an email, when all other checks have succeeded.
 
 onEnhancedChangesList__getLogText ( $changesList, &$links, $block)
 Use this hook to alter, remove, or add to the links of a group of changes in EnhancedChangesList.
 
 onEnhancedChangesListModifyBlockLineData ( $changesList, &$data, $rc)
 Use this hook to alter data used to build a non-grouped recent change line in EnhancedChangesList.
 
 onEnhancedChangesListModifyLineData ( $changesList, &$data, $block, $rc, &$classes, &$attribs)
 Use this hook to alter data used to build a grouped recent change inner line in EnhancedChangesList.
 
 onExemptFromAccountCreationThrottle ( $ip)
 Use this hook to add an exemption from the account creation throttle.
 
 onExtensionTypes (&$extTypes)
 This hook is called when generating the extensions credits.
 
 onFetchChangesList ( $user, $skin, &$list, $groups)
 This hook is called when fetching the ChangesList derivative for a particular user.
 
 onFileDeleteComplete ( $file, $oldimage, $article, $user, $reason)
 This hook is called when a file is deleted.
 
 onFileTransformed ( $file, $thumb, $tmpThumbPath, $thumbPath)
 This hook is called when a file is transformed and moved into storage.
 
 onFileUndeleteComplete ( $title, $fileVersions, $user, $reason)
 This hook is called when a file is undeleted.
 
 onFileUpload ( $file, $reupload, $hasDescription)
 This hook is called when a file upload occurs.
 
 onFormatAutocomments (&$comment, $pre, $auto, $post, $title, $local, $wikiId)
 This hook is called when an autocomment is formatted by the Linker.
 
 onGalleryGetModes (&$modeArray)
 Use this hook to get a list of classes that can render different modes of a gallery.
 
 onGetActionName (IContextSource $context, string &$action)
 Use this hook to override the action name depending on request parameters.
 
 onGetAllBlockActions (&$actions)
 Use this hook to add an action or actions that may be blocked by a partial block.
 
 onGetAutoPromoteGroups ( $user, &$promote)
 This hook is called when determining which autopromote groups a user is entitled to be in.
 
 onGetBlockErrorMessageKey ( $block, &$key)
 
 onGetCacheVaryCookies ( $out, &$cookies)
 Use this hook to get cookies that should vary cache options.
 
 onGetCanonicalURL ( $title, &$url, $query)
 Use this hook to modify fully-qualified URLs used for IRC and email notifications.
 
 onGetContentModels (&$models)
 Use this hook to add content models to the list of available models.
 
 onGetDefaultSortkey ( $title, &$sortkey)
 Use this hook to override the default sortkey for a page.
 
 onGetDifferenceEngine ( $context, $old, $new, $refreshCache, $unhide, &$differenceEngine)
 This hook is called when getting a new difference engine interface object.
 
 onGetDoubleUnderscoreIDs (&$doubleUnderscoreIDs)
 Use this hook to modify the list of behavior switches (double underscore variables in wikitext).
 
 onGetExtendedMetadata (&$combinedMeta, $file, $context, $single, &$maxCacheTime)
 Use this hook to get extended file metadata for the API.
 
 onGetFullURL ( $title, &$url, $query)
 Use this hook to modify fully-qualified URLs used in redirects/export/offsite data.
 
 onGetHumanTimestamp (&$output, $timestamp, $relativeTo, $user, $lang)
 Use this hook to preemptively override the human-readable timestamp generated by Language::getHumanTimestamp().
 
 onGetInternalURL ( $title, &$url, $query)
 Use this hook to modify fully-qualified URLs used for squid cache purging.
 
 onGetIP (&$ip)
 Use this hook to modify the IP of the current user (called only once).
 
 onGetLangPreferredVariant (&$req)
 This hook is called in LanguageConverter::getPreferredVariant() to allow fetching the language variant code from cookies or other such alternative storage.
 
 onGetLinkColours ( $linkcolour_ids, &$colours, $title)
 Use this hook to modify the CSS class of an array of page links.
 
 onGetLocalURL ( $title, &$url, $query)
 Use this hook to modify local URLs as output into page links.
 
 onGetLocalURL__Article ( $title, &$url)
 Use this hook to modify local URLs specifically pointing to article paths without any fancy queries or variants.
 
 onGetLocalURL__Internal ( $title, &$url, $query)
 Use this hook to modify local URLs to internal pages.
 
 onGetLogTypesOnUser (&$types)
 Use this hook to add log types where the target is a user page.
 
 onGetMagicVariableIDs (&$variableIDs)
 Use this hook to modify the list of magic variables.
 
 onGetMetadataVersion (&$version)
 Use this hook to modify the image metadata version currently in use.
 
 onGetNewMessagesAlert (&$newMessagesAlert, $newtalks, $user, $out)
 Use this hook to disable or modify the new messages alert.
 
 onGetPreferences ( $user, &$preferences)
 Use this hook to modify user preferences.
 
 onGetRelativeTimestamp (&$output, &$diff, $timestamp, $relativeTo, $user, $lang)
 Use this hook to pre-emptively override the relative timestamp generated by MWTimestamp::getRelativeTimestamp().
 
 onGetSlotDiffRenderer ( $contentHandler, &$slotDiffRenderer, $context)
 Use this hook to replace or wrap the standard SlotDiffRenderer for some content type.
 
 onGetUserBlock ( $user, $ip, &$block)
 Use this hook to modify the block found by the block manager.
 
 onGetUserPermissionsErrors ( $title, $user, $action, &$result)
 Use this hook to add a permissions error when permissions errors are checked for.
 
 onGetUserPermissionsErrorsExpensive ( $title, $user, $action, &$result)
 This hook is equal to getUserPermissionsErrors, but it is called only if expensive checks are enabled.
 
 onGitViewers (&$extTypes)
 This hook is called when generating the list of git viewers for Special:Version, allowing you to modify the list.
 
 onHistoryPageToolLinks (IContextSource $context, LinkRenderer $linkRenderer, array &$links)
 Use this hook to add one or more links to revision history page subtitle.
 
 onHistoryTools ( $revRecord, &$links, $prevRevRecord, $userIdentity)
 Use this hook to override or extend the revision tools available from the page history view, i.e.
 
 onHtmlCacheUpdaterAppendUrls ( $title, $mode, &$append)
 This hook is used to declare extra URLs to purge from HTTP caches.
 
 onHtmlCacheUpdaterVaryUrls ( $urls, &$append)
 This hook is used to add variants of URLs to purge from HTTP caches.
 
 onHTMLFileCache__useFileCache ( $context)
 Use this hook to override whether a page should be cached in file cache.
 
 onHtmlPageLinkRendererBegin ( $linkRenderer, $target, &$text, &$customAttribs, &$query, &$ret)
 This hook is called when generating internal and interwiki links in LinkRenderer, before processing starts.
 
 onHtmlPageLinkRendererEnd ( $linkRenderer, $target, $isKnown, &$text, &$attribs, &$ret)
 This hook is called when generating internal and interwiki links in LinkRenderer, just before the function returns a value.
 
 onImageBeforeProduceHTML ( $linker, &$title, &$file, &$frameParams, &$handlerParams, &$time, &$res, $parser, &$query, &$widthOption)
 This hook is called before producing the HTML created by a wiki image insertion.
 
 onImageOpenShowImageInlineBefore ( $imagePage, $output)
 This hook is called just before showing the image on an image page.
 
 onImagePageAfterImageLinks ( $imagePage, &$html)
 This hook is called after the image links section on an image page is built.
 
 onImagePageFileHistoryLine ( $imageHistoryList, $file, &$line, &$css)
 This hook is called when a file history line is constructed.
 
 onImagePageFindFile ( $page, &$file, &$displayFile)
 This hook is called when fetching the file associated with an image page.
 
 onImagePageShowTOC ( $page, &$toc)
 This hook is called when the file toc on an image page is generated.
 
 onImgAuthBeforeStream (&$title, &$path, &$name, &$result)
 This hook is called before a file is streamed to a user, but only when using img_auth.php.
 
 onImgAuthModifyHeaders ( $title, &$headers)
 This hook is called just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand.
 
 onImportHandleContentXMLTag ( $reader, $contentInfo)
 This hook is called when parsing a content XML tag.
 
 onImportHandleLogItemXMLTag ( $reader, $logInfo)
 This hook is called when parsing an XML tag in a log item.
 
 onImportHandlePageXMLTag ( $reader, &$pageInfo)
 This hook is called when parsing an XML tag in a page.
 
 onImportHandleRevisionXMLTag ( $reader, $pageInfo, $revisionInfo)
 This hook is called when parsing an XML tag in a page revision.
 
 onImportHandleToplevelXMLTag ( $reader)
 This hook is called when parsing a top level XML tag.
 
 onImportHandleUnknownUser ( $name)
 When a user doesn't exist locally, use this hook to auto-create it.
 
 onImportHandleUploadXMLTag ( $reader, $revisionInfo)
 This hook is called when parsing an XML tag in a file upload.
 
 onImportLogInterwikiLink (&$fullInterwikiPrefix, &$pageTitle)
 Use this hook to change interwiki links in log entries and edit summaries for transwiki imports.
 
 onImportSources (&$importSources)
 This hook is called when reading from the $wgImportSources configuration variable.
 
 onInfoAction ( $context, &$pageInfo)
 This hook is called when building information to display on the action=info page.
 
 onInitializeArticleMaybeRedirect ( $title, $request, &$ignoreRedirect, &$target, &$article)
 Use this hook to override whether a title is a redirect.
 
 onInternalParseBeforeLinks ( $parser, &$text, $stripState)
 This hook is called during Parser's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processing.
 
 onInterwikiLoadPrefix ( $prefix, &$iwData)
 This hook is called when resolving whether a given prefix is an interwiki or not.
 
 onInvalidateEmailComplete ( $user)
 This hook is called after a user's email has been invalidated successfully.
 
 onIRCLineURL (&$url, &$query, $rc)
 This hook is called when constructing the URL to use in an RCFeed notification.
 
 onIsFileCacheable ( $article)
 Use this hook to override the result of Article::isFileCacheable().
 
 onIsTrustedProxy ( $ip, &$result)
 Use this hook to override the result of ProxyLookup::isTrustedProxy().
 
 onIsUploadAllowedFromUrl ( $url, &$allowed)
 Use this hook to override the result of UploadFromUrl::isAllowedUrl().
 
 onIsValidEmailAddr ( $addr, &$result)
 Use this hook to override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn't match your organization.
 
 onIsValidPassword ( $password, &$result, $user)
 Use this hook to override the result of User::isValidPassword()
 
 onJsonValidateSave (JsonContent $content, PageIdentity $pageIdentity, StatusValue $status)
 Use this hook to add additional validations for JSON content pages.
 
 onLanguage__getMessagesFileName ( $code, &$file)
 Use this hook to change the path of a localisation file.
 
 onLanguageGetNamespaces (&$namespaces)
 Use this hook to provide custom ordering for namespaces or remove namespaces.
 
 onLanguageGetTranslatedLanguageNames (&$names, $code)
 Use this hook to provide translated language names.
 
 onLanguageLinks ( $title, &$links, &$linkFlags)
 Use this hook to manipulate a page's language links.
 
 onLanguageSelector ( $out, $cssClassName)
 Use this hook to change the language selector available on a page.
 
 onLinkerGenerateRollbackLink ( $revRecord, $context, $options, &$inner)
 This hook is called before a rollback link is displayed to allow for customizing the appearance of the link or substituting it with something entirely different.
 
 onLinkerMakeExternalImage (&$url, &$alt, &$img)
 This hook is called at the end of Linker::makeExternalImage() just before the return.
 
 onLinkerMakeExternalLink (&$url, &$text, &$link, &$attribs, $linkType)
 This hook is called at the end of Linker::makeExternalLink() just before the return.
 
 onLinkerMakeMediaLinkFile ( $title, $file, &$html, &$attribs, &$ret)
 This hook is called at the end of Linker::makeMediaLinkFile() just before the return.
 
 onLinksUpdate ( $linksUpdate)
 This hook is called at the beginning of LinksUpdate::doUpdate() just before the actual update.
 
 onLinksUpdateComplete ( $linksUpdate, $ticket)
 This hook is called at the end of LinksUpdate::doUpdate() when updating, including delete and insert, has completed for all link tables.
 
 onListDefinedTags (&$tags)
 This hook is called when trying to find all defined tags.
 
 onLoadExtensionSchemaUpdates ( $updater)
 This hook is called during database installation and updates.
 
 onLoadUserOptions (UserIdentity $user, array &$options)
 This hook is called when user options/preferences are being loaded from the database.
 
 onLocalFile__getHistory ( $file, &$tables, &$fields, &$conds, &$opts, &$join_conds)
 This hook is called before a file history query is performed.
 
 onLocalFilePurgeThumbnails ( $file, $archiveName, $urls)
 This hook is called before thumbnails for a local file are purged.
 
 onLocalisationCacheRecache ( $cache, $code, &$alldata, $unused)
 Called when loading the localisation data into cache.
 
 onLocalisationCacheRecacheFallback ( $cache, $code, &$alldata)
 Called for each language when merging fallback data into the cache.
 
 onLocalUserCreated ( $user, $autocreated)
 This hook is called when a local user has been created.
 
 onLogEventsListGetExtraInputs ( $type, $logEventsList, &$input, &$formDescriptor)
 This hook is called when getting extra inputs to display on Special:Log for a specific log type.
 
 onLogEventsListLineEnding ( $page, &$ret, $entry, &$classes, &$attribs)
 This hook is called before a Special:Log line is finished.
 
 onLogEventsListShowLogExtract (&$s, $types, $page, $user, $param)
 This hook is called before the string is added to OutputPage.
 
 onLogException ( $e, $suppressed)
 This hook is called before an exception (or PHP error) is logged.
 
 onLoginFormValidErrorMessages (array &$messages)
 This hook is called in LoginForm when a function gets valid error messages.
 
 onLogLine ( $log_type, $log_action, $title, $paramArray, &$comment, &$revert, $time)
 Use this hook to process a single log entry on Special:Log.
 
 onLonelyPagesQuery (&$tables, &$conds, &$joinConds)
 Use this hook to modify the query used by Special:LonelyPages.
 
 onMagicWordwgVariableIDs (&$variableIDs)
 This hook is called when defining new magic words IDs.
 
 onMaintenanceRefreshLinksInit ( $refreshLinks)
 This hook is called before executing the refreshLinks.php maintenance script.
 
 onMaintenanceShellStart ()
 This hook is called before maintenance script shells start, such as eval.php and shell.php.
 
 onMaintenanceUpdateAddParams (&$params)
 Use this hook to add params to the update.php maintenance script.
 
 onMakeGlobalVariablesScript (&$vars, $out)
 Export user- or page-specific mw.config variables to JavaScript.
 
 onManualLogEntryBeforePublish ( $logEntry)
 Use this hook to access or modify log entry just before it is published.
 
 onMarkPatrolled ( $rcid, $user, $wcOnlySysopsCanPatrol, $auto, &$tags)
 This hook is called before an edit is marked patrolled.
 
 onMarkPatrolledComplete ( $rcid, $user, $wcOnlySysopsCanPatrol, $auto)
 This hook is called after an edit is marked patrolled.
 
 onMediaWikiPerformAction ( $output, $article, $title, $user, $request, $mediaWiki)
 Use this hook to override ActionEntryPoint::performAction().
 
 onMediaWikiServices ( $services)
 This hook is called when a global MediaWikiServices instance is initialized.
 
 onMessageCache__get (&$key)
 This hook is called when fetching a message.
 
 onMessageCacheFetchOverrides (array &$messages)
 This hook is called to fetch overrides.
 
 onMessageCacheReplace ( $title, $text)
 This hook is called when a message page is changed.
 
 onMessagesPreLoad ( $title, &$message, $code)
 This hook is called when loading a message from the database.
 
 onMimeMagicGuessFromContent ( $mimeMagic, &$head, &$tail, $file, &$mime)
 Use this hook to guess the MIME by content.
 
 onMimeMagicImproveFromExtension ( $mimeMagic, $ext, &$mime)
 Use this hook to further improve the MIME type detected by considering the file extension.
 
 onMimeMagicInit ( $mimeMagic)
 This hook is called before processing the list mapping MIME types to media types and the list mapping MIME types to file extensions.
 
 onModifyExportQuery ( $db, &$tables, $cond, &$opts, &$join_conds, &$conds)
 Use this hook to modify the query used by the exporter.
 
 onMovePageCheckPermissions ( $oldTitle, $newTitle, $user, $reason, $status)
 Use this hook to specify whether the user is allowed to move the page.
 
 onMovePageIsValidMove ( $oldTitle, $newTitle, $status)
 Use this hook to specify whether a page can be moved for technical reasons.
 
 onMultiContentSave ( $renderedRevision, $user, $summary, $flags, $status)
 This hook is called before an article is saved.
 
 onNamespaceIsMovable ( $index, &$result)
 This hook is called when determining if it is possible to move pages in a namespace.
 
 onNewDifferenceEngine ( $title, &$oldId, &$newId, $old, $new)
 This hook is called when a new DifferenceEngine object is made.
 
 onNewPagesLineEnding ( $page, &$ret, $row, &$classes, &$attribs)
 This hook is called before a NewPages line is finished.
 
 onOldChangesListRecentChangesLine ( $changeslist, &$s, $rc, &$classes, &$attribs)
 Use this hook to customize a recent changes line.
 
 onOpenSearchUrls (&$urls)
 This hook is called when constructing the OpenSearch description XML.
 
 onOpportunisticLinksUpdate ( $page, $title, $parserOutput)
 This hook is called by WikiPage::triggerOpportunisticLinksUpdate when a page view triggers a re-rendering of the page.
 
 onOtherAutoblockLogLink (&$otherBlockLink)
 Use this hook to add list items to a list of "other autoblocks" which appears at the end of Special:AutoblockList.
 
 onOtherBlockLogLink (&$otherBlockLink, $ip)
 Use this hook to add list items to a list of "other blocks" when viewing Special:BlockList.
 
 onOutputPageAfterGetHeadLinksArray (&$tags, $out)
 This hook is called in OutputPage::getHeadLinksArray right before returning the result.
 
 onOutputPageBeforeHTML ( $out, &$text)
 This hook is called when a page has been processed by the parser and the resulting HTML is about to be displayed.
 
 onOutputPageBodyAttributes ( $out, $sk, &$bodyAttrs)
 This hook is called when OutputPage::headElement is creating the body tag to allow for extensions to add attributes to the body of the page they might need.
 
 onOutputPageCheckLastModified (&$modifiedTimes, $out)
 This hook is called when checking if the page has been modified since the last visit.
 
 onOutputPageMakeCategoryLinks ( $out, $categories, &$links)
 This hook is called when links are about to be generated for the page's categories.
 
 onOutputPageParserOutput ( $outputPage, $parserOutput)
 This hook is called after adding a parserOutput to $wgOut.
 
 onPageContentLanguage ( $title, &$pageLang, $userLang)
 Use this hook to change the language in which the content of a page is written.
 
 onPageContentSave ( $wikiPage, $user, $content, &$summary, $isminor, $iswatch, $section, $flags, $status)
 This hook is called before an article is saved.
 
 onPageDelete (ProperPageIdentity $page, Authority $deleter, string $reason, StatusValue $status, bool $suppress)
 This hook is called before a page is deleted.
 
 onPageDeleteComplete (ProperPageIdentity $page, Authority $deleter, string $reason, int $pageID, RevisionRecord $deletedRev, ManualLogEntry $logEntry, int $archivedRevisionCount)
 This hook is called after a page is deleted.
 
 onPageDeletionDataUpdates ( $title, $revision, &$updates)
 This hook is called when constructing a list of DeferrableUpdate to be executed when a page is deleted.
 
 onPageHistoryBeforeList ( $article, $context)
 This hook is called when a history page list is about to be constructed.
 
 onPageHistoryLineEnding ( $historyAction, &$row, &$s, &$classes, &$attribs)
 This hook is called right before the <li> is generated for a history line.
 
 onPageHistoryPager__doBatchLookups ( $pager, $result)
 This hook is called after the pager query was run, before any output is generated, to allow batch lookups for prefetching information needed for display.
 
 onPageHistoryPager__getQueryInfo ( $pager, &$queryInfo)
 This hook is called when a history pager query parameter set is constructed.
 
 onPageMoveComplete ( $old, $new, $user, $pageid, $redirid, $reason, $revision)
 This hook is called after moving an article (title), post-commit.
 
 onPageMoveCompleting ( $old, $new, $user, $pageid, $redirid, $reason, $revision)
 This hook is called after moving an article (title), pre-commit.
 
 onPageRenderingHash (&$confstr, $user, &$forOptions)
 NOTE: Consider using ParserOptionsRegister instead.
 
 onPageSaveComplete ( $wikiPage, $user, $summary, $flags, $revisionRecord, $editResult)
 This hook is called after an article has been updated.
 
 onPageUndelete (ProperPageIdentity $page, Authority $performer, string $reason, bool $unsuppress, array $timestamps, array $fileVersions, StatusValue $status)
 This hook is called before (part of) a page is undeleted.
 
 onPageUndeleteComplete (ProperPageIdentity $page, Authority $restorer, string $reason, RevisionRecord $restoredRev, ManualLogEntry $logEntry, int $restoredRevisionCount, bool $created, array $restoredPageIds)
 This hook is called after a page is undeleted.
 
 onPageViewUpdates ( $wikipage, $user)
 Use this hook to make database (or other) changes after a page view is seen by MediaWiki.
 
 onParserAfterParse ( $parser, &$text, $stripState)
 This hook is called from Parser::parse() just after the call to Parser::internalParse() returns.
 
 onParserAfterTidy ( $parser, &$text)
 This hook is called after Parser::tidy() in Parser::parse().
 
 onParserBeforeInternalParse ( $parser, &$text, $stripState)
 This hook is called at the beginning of Parser::internalParse().
 
 onParserBeforePreprocess ( $parser, &$text, $stripState)
 Called at the beginning of Parser::preprocess()
 
 onParserCacheSaveComplete ( $parserCache, $parserOutput, $title, $popts, $revId)
 This hook is called after a ParserOutput has been committed to the parser cache.
 
 onParserClearState ( $parser)
 This hook is called at the end of Parser::clearState().
 
 onParserCloned ( $parser)
 This hook is called when the parser is cloned.
 
 onParserFetchTemplateData (array $titles, array &$tplData)
 This hook allows Parsoid to fetch additional serialization information about a Template, including the type of its arguments, whether they should be serialized as inline or block style wikitext, etc.
 
 onParserFirstCallInit ( $parser)
 This hook is called when the parser initialises for the first time.
 
 onParserGetVariableValueSwitch ( $parser, &$variableCache, $magicWordId, &$ret, $frame)
 This hook is called when the parser needs the value of a custom magic word.
 
 onParserGetVariableValueTs ( $parser, &$time)
 Use this hook to change the value of the time for time-related magic words, ie {{CURRENTMONTH}}, {{LOCALMONTH}}, etc.
 
 onParserLimitReportFormat ( $key, &$value, &$report, $isHTML, $localize)
 This hook is called for each row in the parser limit report that needs formatting.
 
 onParserLimitReportPrepare ( $parser, $output)
 This hook is called at the end of Parser:parse() when the parser will include comments about size of the text parsed.
 
 onParserLogLinterData (string $title, int $revId, array $lints)
 This hook allows Parsoid to log additional linting information during a parse to a database maintained by the [[Extension:Linter]].
 
 onParserMakeImageParams ( $title, $file, &$params, $parser)
 This hook is called before the parser generates an image link, use this to modify the parameters of the image.
 
 onParserModifyImageHTML (Parser $parser, File $file, array $params, string &$html)
 This hook is called for each image added to parser output, with its associated HTML as returned from Linker::makeImageLink().
 
 onParserOptionsRegister (&$defaults, &$inCacheKey, &$lazyLoad)
 Use this hook to register additional parser options.
 
 onParserOutputPostCacheTransform ( $parserOutput, &$text, &$options)
 This hook is called from ParserOutput::getText() to do post-cache transforms.
 
 onParserOutputStashForEdit ( $page, $content, $output, $summary, $user)
 This hook is called when an edit stash parse finishes, before the output is cached.
 
 onParserPreSaveTransformComplete ( $parser, &$text)
 This hook is called from Parser::preSaveTransform() after processing is complete, giving the extension a chance to further modify the wikitext.
 
 onParserTestGlobals (&$globals)
 Use this hook to define globals for parser tests.
 
 onPasswordPoliciesForUser ( $user, &$effectivePolicy)
 Use this hook to alter the effective password policy for a user.
 
 onPerformRetroactiveAutoblock ( $block, &$blockIds)
 This hook is called before a retroactive autoblock is applied to a user.
 
 onPermissionErrorAudit (LinkTarget $title, UserIdentity $user, string $action, string $rigor, array $errors)
 This hook is called from PermissionManager::getPermissionErrorsInternal() to collect internal permission errors and make them available to consumers.
 
 onPingLimiter ( $user, $action, &$result, $incrBy)
 Use this hook to override the results of User::pingLimiter().
 
 onPlaceNewSection ( $content, $oldtext, $subject, &$text)
 Use this hook to override placement of new sections.
 
 onPostLoginRedirect (&$returnTo, &$returnToQuery, &$type)
 Use this hook to modify the post login redirect behavior.
 
 onPreferencesFormPreSave ( $formData, $form, $user, &$result, $oldUserOptions)
 Use this hook to override preferences being saved.
 
 onPreferencesGetIcon (&$iconNames)
 Use the hook to add an icon that will be displayed in the mobile layout of Special:Preferences.
 
 onPreferencesGetLayout (&$useMobileLayout, $skinName, $skinProperties=[])
 Use the hook to check if the preferences will have a mobile or desktop layout.
 
 onPreferencesGetLegend ( $form, $key, &$legend)
 Use the hook to override the text used for the <legend> of a preferences section.
 
 onPrefixSearchBackend ( $ns, $search, $limit, &$results, $offset)
 Use this hook to override the title prefix search used for OpenSearch and AJAX search suggestions.
 
 onPrefixSearchExtractNamespace (&$namespaces, &$search)
 This hook is called if core was not able to extract a namespace from the search string so that extensions can attempt it.
 
 onPrefsEmailAudit ( $user, $oldaddr, $newaddr)
 This hook is called when user changes their email address.
 
 onProtectionForm__buildForm ( $article, &$output)
 This hook is called after all protection type fieldsets are made in the form.
 
 onProtectionForm__save ( $article, &$errorMsg, $reasonstr)
 This hook is called when a protection form is submitted.
 
 onProtectionForm__showLogExtract ( $article, $out)
 This hook is called after the protection log extract is shown.
 
 onProtectionFormAddFormFields ( $article, &$hookFormOptions)
 This hook is called after all protection type form fields are added.
 
 onRandomPageQuery (&$tables, &$conds, &$joinConds)
 Use this hook to modify the query used by Special:Random to select random pages.
 
 onRawPageViewBeforeOutput ( $obj, &$text)
 This hook is called right before the text is blown out in action=raw.
 
 onRecentChange_save ( $recentChange)
 This hook is called at the end of RecentChange::save().
 
 onRecentChangesPurgeRows ( $rows)
 This hook is called by RecentChangesUpdateJob when expired recentchanges rows are deleted, after deleting those rows but within the same database transaction.
 
 onRedirectSpecialArticleRedirectParams (&$redirectParams)
 Use this hook to alter the set of parameter names such as "oldid" that are preserved when using redirecting special pages such as Special:MyPage and Special:MyTalk.
 
 onRejectParserCacheValue ( $parserOutput, $wikiPage, $parserOptions)
 Use this hook to reject an otherwise usable cached value from the Parser cache.
 
 onRenameUserAbort (int $uid, string $old, string $new)
 Allows the renaming to be aborted.
 
 onRenameUserComplete (int $uid, string $old, string $new)
 Called after a user was renamed.
 
 onRenameUserPreRename (int $uid, string $old, string $new)
 Called before a user is renamed.
 
 onRenameUserSQL (RenameuserSQL $renameUserSql)
 Called in the constructer of RenameuserSQL (which performs the actual renaming of users).
 
 onRenameUserWarning (string $oldUsername, string $newUsername, array &$warnings)
 Called on Special:Renameuser before a user is renamed.
 
 onRequestContextCreateSkin ( $context, &$skin)
 This hook is called when RequestContext::getSkin creates a skin instance.
 
 onResetPasswordExpiration ( $user, &$newExpire)
 Use this hook to allow extensions to set a default password expiration.
 
 onRevisionDataUpdates ( $title, $renderedRevision, &$updates)
 This hook is called when constructing a list of DeferrableUpdate to be executed to record secondary data about a revision.
 
 onRevisionFromEditComplete ( $wikiPage, $rev, $originalRevId, $user, &$tags)
 This hook is called when a revision was inserted due to an edit, file upload, import or page move.
 
 onRevisionRecordInserted ( $revisionRecord)
 This hook is called after a revision is inserted into the database.
 
 onRevisionUndeleted ( $revisionRecord, $oldPageID)
 After an article revision is restored.
 
 onRollbackComplete ( $wikiPage, $user, $revision, $current)
 After an article rollback is completed.
 
 onSaveUserOptions (UserIdentity $user, array &$modifiedOptions, array $originalOptions)
 This hook is called just before saving user preferences.
 
 onSearchableNamespaces (&$arr)
 Use this hook to modify which namespaces are searchable.
 
 onSearchAfterNoDirectMatch ( $term, &$title)
 This hook is called if there was no match for the exact result.
 
 onSearchDataForIndex (&$fields, $handler, $page, $output, $engine)
 Use this hook to add data to search document.
 
 onSearchDataForIndex2 (array &$fields, \ContentHandler $handler, \WikiPage $page, ParserOutput $output, \SearchEngine $engine, RevisionRecord $revision)
 
 onSearchGetNearMatch ( $term, &$title)
 Use this hook to perform exact-title-matches in "go" searches if nothing was found.
 
 onSearchGetNearMatchBefore ( $allSearchTerms, &$titleResult)
 Use this hook to perform exact-title-matches in "go" searches before the normal operations.
 
 onSearchGetNearMatchComplete ( $term, &$title)
 Use this hook to modify exact-title-matches in "go" searches.
 
 onSearchIndexFields (&$fields, $engine)
 Use this hook to add fields to search index mapping.
 
 onSearchResultInitFromTitle ( $title, &$id)
 Use this hook to set the revision used when displaying a page in search results.
 
 onSearchResultProvideDescription (array $pageIdentities, &$descriptions)
 This hook is called when generating search results in order to fill the 'description' field in an extension.
 
 onSearchResultProvideThumbnail (array $pageIdentities, &$thumbnails, int $size=null)
 This hook is called when generating search results in order to fill the 'thumbnail' field in an extension.
 
 onSearchResultsAugment (&$setAugmentors, &$rowAugmentors)
 Use this hook to add code to the list of search result augmentors.
 
 onSecuritySensitiveOperationStatus (&$status, $operation, $session, $timeSinceAuth)
 Use this hook to affect the return value from MediaWiki\Auth\AuthManager::securitySensitiveOperationStatus().
 
 onSelfLinkBegin ( $nt, &$html, &$trail, &$prefix, &$ret)
 This hook is called before a link to the current article is displayed to allow the display of the link to be customized.
 
 onSendWatchlistEmailNotification ( $targetUser, $title, $enotif)
 Use this hook to cancel watchlist email notifications (enotifwatchlist) for an edit.
 
 onSessionCheckInfo (&$reason, $info, $request, $metadata, $data)
 Use this hook to validate a MediaWiki\Session\SessionInfo as it's being loaded from storage.
 
 onSessionMetadata ( $backend, &$metadata, $requests)
 Use this hook to add metadata to a session being saved.
 
 onSetupAfterCache ()
 This hook is called in Setup.php, after cache objects are set.
 
 onShortPagesQuery (&$tables, &$conds, &$joinConds, &$options)
 Use this hook to modify the query used by Special:ShortPages.
 
 onShowMissingArticle ( $article)
 This hook is called when generating the output for a non-existent page.
 
 onShowSearchHit ( $searchPage, $result, $terms, &$link, &$redirect, &$section, &$extract, &$score, &$size, &$date, &$related, &$html)
 Use this hook to customize display of search hit.
 
 onShowSearchHitTitle (&$title, &$titleSnippet, $result, $terms, $specialSearch, &$query, &$attributes)
 Use this hook to customise display of search hit title/link.
 
 onSidebarBeforeOutput ( $skin, &$sidebar)
 Use this hook to edit the sidebar just before it is output by skins.
 
 onSiteNoticeAfter (&$siteNotice, $skin)
 This hook is called after the sitenotice/anonnotice is composed.
 
 onSiteNoticeBefore (&$siteNotice, $skin)
 This hook is called before the sitenotice/anonnotice is composed.
 
 onSkinAddFooterLinks (Skin $skin, string $key, array &$footerItems)
 This hook is called when generating the code used to display the footer.
 
 onSkinAfterBottomScripts ( $skin, &$text)
 This hook is called in OutputPage::getBottomScripts() and allows to add extra html at the end of bottom scripts section.
 
 onSkinAfterContent (&$data, $skin)
 Use this hook to add text after the page content and article metadata.
 
 onSkinAfterPortlet ( $skin, $portlet, &$html)
 This hook is called when generating portlets.
 
 onSkinBuildSidebar ( $skin, &$bar)
 This hook is called at the end of Skin::buildSidebar().
 
 onSkinCopyrightFooter ( $title, $type, &$msg, &$link)
 Use this hook for site and per-namespace customization of the copyright notice.
 
 onSkinEditSectionLinks ( $skin, $title, $section, $tooltip, &$result, $lang)
 Use this hook to modify section edit links.
 
 onSkinPageReadyConfig (RL\Context $context, array &$config)
 Allows skins to change the mediawiki.page.ready module configuration.
 
 onSkinPreloadExistence (&$titles, $skin)
 Use this hook to supply titles that should be added to link existence cache before the page is rendered.
 
 onSkinSubPageSubtitle (&$subpages, $skin, $out)
 This hook is called at the beginning of Skin::subPageSubtitle().
 
 onSkinTemplateGetLanguageLink (&$languageLink, $languageLinkTitle, $title, $outputPage)
 This hook is called after building the data for a language link from which the actual html is constructed.
 
 onSkinTemplateNavigation__Universal ( $sktemplate, &$links)
 This hook is called on both content and special pages after variants have been added.
 
 onSoftwareInfo (&$software)
 This hook is called by Special:Version for returning information about the software.
 
 onSpecialBlockModifyFormFields ( $sp, &$fields)
 Use this hook to add more fields to Special:Block.
 
 onSpecialContributions__formatRow__flags ( $context, $row, &$flags)
 This hook is called before rendering a Special:Contributions row.
 
 onSpecialContributions__getForm__filters ( $sp, &$filters)
 This hook is called with a list of filters to render on Special:Contributions.
 
 onSpecialContributionsBeforeMainOutput ( $id, $user, $sp)
 This hook is called before the form on Special:Contributions.
 
 onSpecialCreateAccountBenefits (?string &$html, array $info, array &$options)
 Replace the default signup page content about the benefits of registering an account ("Wikipedia is made by people like you...") on Special:CreateAccount.
 
 onSpecialExportGetExtraPages ( $inputPages, &$extraPages)
 
 onSpecialListusersDefaultQuery ( $pager, &$query)
 This hook is called right before the end of UsersPager::getDefaultQuery().
 
 onSpecialListusersFormatRow (&$item, $row)
 This hook is called right before the end of UsersPager::formatRow().
 
 onSpecialListusersHeader ( $pager, &$out)
 This hook is called after adding the submit button in UsersPager::getPageHeader().
 
 onSpecialListusersHeaderForm ( $pager, &$out)
 This hook is called before adding the submit button in UsersPager::getPageHeader().
 
 onSpecialListusersQueryInfo ( $pager, &$query)
 This hook is called right before the end of UsersPager::getQueryInfo()
 
 onSpecialLogAddLogSearchRelations ( $type, $request, &$qc)
 Use this hook to add log relations to the current log.
 
 onSpecialMovepageAfterMove ( $movePage, $oldTitle, $newTitle)
 This hook is called after moving a page.
 
 onSpecialMuteModifyFormFields ( $target, $user, &$fields)
 Use this hook to add more fields to Special:Mute.
 
 onSpecialNewpagesConditions ( $special, $opts, &$conds, &$tables, &$fields, &$join_conds)
 This hook is called when building the SQL query for Special:NewPages.
 
 onSpecialNewPagesFilters ( $special, &$filters)
 This hook is called after building form options at NewPages.
 
 onSpecialPage_initList (&$list)
 This hook is called when setting up SpecialPageFactory::$list.
 
 onSpecialPageAfterExecute ( $special, $subPage)
 This hook is called after SpecialPage::execute.
 
 onSpecialPageBeforeExecute ( $special, $subPage)
 This hook is called before SpecialPage::execute.
 
 onSpecialPageBeforeFormDisplay ( $name, $form)
 This hook is called before executing the HTMLForm object.
 
 onSpecialPasswordResetOnSubmit (&$users, $data, &$error)
 This hook is called when executing a form submission on Special:PasswordReset.
 
 onSpecialPrefixIndexGetFormFilters (IContextSource $contextSource, array &$filters)
 This hook is called with a list of filters to render on Special:PrefixIndex.
 
 onSpecialPrefixIndexQuery (array $fieldData, SelectQueryBuilder $queryBuilder)
 Use this hook to modify the query used by Special:PrefixIndex.
 
 onSpecialRandomGetRandomTitle (&$randstr, &$isRedir, &$namespaces, &$extra, &$title)
 This hook is called during the execution of Special:Random,.
 
 onSpecialRecentChangesPanel (&$extraOpts, $opts)
 This hook is called when building form options in SpecialRecentChanges.
 
 onSpecialResetTokensTokens (&$tokens)
 This hook is called when building token list for SpecialResetTokens.
 
 onSpecialSearchCreateLink ( $t, &$params)
 This hook is called when making the message to create a page or go to the existing page.
 
 onSpecialSearchGoResult ( $term, $title, &$url)
 Use this hook to alter the behaviour of the 'go' feature when searching.
 
 onSpecialSearchNogomatch (&$title)
 This hook is called when the 'Go' feature is triggered and the target doesn't exist.
 
 onSpecialSearchPowerBox (&$showSections, $term, &$opts)
 Use this hook to modify advanced search profile forms.
 
 onSpecialSearchProfileForm ( $search, &$form, $profile, $term, $opts)
 Use this hook to modify search profile forms.
 
 onSpecialSearchProfiles (&$profiles)
 Use this hook to modify search profiles.
 
 onSpecialSearchResults ( $term, &$titleMatches, &$textMatches)
 This hook is called before search result display.
 
 onSpecialSearchResultsAppend ( $specialSearch, $output, $term)
 This hook is called immediately before returning HTML on the search results page.
 
 onSpecialSearchResultsPrepend ( $specialSearch, $output, $term)
 This hook is called immediately before returning HTML on the search results page.
 
 onSpecialSearchSetupEngine ( $search, $profile, $engine)
 Use this hook for passing custom data to the search engine.
 
 onSpecialStatsAddExtra (&$extraStats, $context)
 Use this hook to add extra statistics at the end of Special:Statistics.
 
 onSpecialTrackingCategories__generateCatLink ( $specialPage, $catTitle, &$html)
 This hook is called for each category link on Special:TrackingCategories.
 
 onSpecialTrackingCategories__preprocess ( $specialPage, $trackingCategories)
 This hook is called after LinkBatch on Special:TrackingCategories.
 
 onSpecialUploadComplete ( $form)
 This hook is called after successfully uploading a file from Special:Upload.
 
 onSpecialVersionVersionUrl ( $version, &$versionUrl)
 This hook is called when building the URL for Special:Version.
 
 onSpecialWatchlistGetNonRevisionTypes (&$nonRevisionTypes)
 This hook is called when building the SQL query for SpecialWatchlist.
 
 onTempUserCreatedRedirect (Session $session, UserIdentity $user, string $returnTo, string $returnToQuery, string $returnToAnchor, &$redirectUrl)
 This hook is called after an action causes a temporary user to be created.
 
 onTestCanonicalRedirect ( $request, $title, $output)
 This hook is called when about to force a redirect to a canonical URL for a title when we have no other parameters on the URL.
 
 onTextSlotDiffRendererTablePrefix (\TextSlotDiffRenderer $textSlotDiffRenderer, IContextSource $context, array &$parts)
 
 onThumbnailBeforeProduceHTML ( $thumbnail, &$attribs, &$linkAttribs)
 This hook is called before an image HTML is about to be rendered (by ThumbnailImage:toHtml method).
 
 onTitleExists ( $title, &$exists)
 This hook is called when determining whether a page exists at a given title.
 
 onTitleGetEditNotices ( $title, $oldid, &$notices)
 Use this hook to add edit notices.
 
 onTitleGetRestrictionTypes ( $title, &$types)
 Use this hook to modify the types of protection that can be applied.
 
 onTitleIsAlwaysKnown ( $title, &$isKnown)
 This hook is called when determining if a page exists.
 
 onTitleIsMovable ( $title, &$result)
 This hook is called when determining if it is possible to move a page.
 
 onTitleMove ( $old, $nt, $user, $reason, &$status)
 
 onTitleMoveStarting ( $old, $nt, $user)
 This hook is called before moving an article (title), but just after the atomic DB section starts.
 
 onTitleQuickPermissions ( $title, $user, $action, &$errors, $doExpensiveQueries, $short)
 This hook is called from Title::checkQuickPermissions to add to or override the quick permissions check.
 
 onTitleReadWhitelist ( $title, $user, &$whitelisted)
 This hook is called at the end of read permissions checks, just before adding the default error message if nothing allows the user to read the page.
 
 onTitleSquidURLs ( $title, &$urls)
 This hook is called to determine which URLs to purge from HTTP caches.
 
 onUnblockUser ( $block, $user, &$reason)
 This hook is called before an IP address or user is unblocked.
 
 onUnblockUserComplete ( $block, $user)
 This hook is called after an IP address or user has been unblocked.
 
 onUndeleteForm__showHistory (&$archive, $title)
 This hook is called in UndeleteForm::showHistory, after creating the PageArchive object.
 
 onUndeleteForm__showRevision (&$archive, $title)
 This hook is called in UndeleteForm::showRevision, after creating a PageArchive object.
 
 onUndeletePageToolLinks (IContextSource $context, LinkRenderer $linkRenderer, array &$links)
 Use this hook to add one or more links to edit page subtitle when a page has been previously deleted.
 
 onUnitTestsAfterDatabaseSetup ( $database, $prefix)
 This hook is called right after MediaWiki's test infrastructure has finished creating/duplicating core tables for unit tests.
 
 onUnitTestsBeforeDatabaseTeardown ()
 This hook is called right before MediaWiki tears down its database infrastructure used for unit tests.
 
 onUnitTestsList (&$paths)
 This hook is called when building a list of paths containing PHPUnit tests.
 
 onUnwatchArticle ( $user, $page, &$status)
 This hook is called before a watch is removed from an article.
 
 onUnwatchArticleComplete ( $user, $page)
 This hook is called after a watch is removed from an article.
 
 onUpdateUserMailerFormattedPageStatus (&$formattedPageStatus)
 This hook is called before a notification email gets sent.
 
 onUploadComplete ( $uploadBase)
 This hook is called upon completion of a file upload.
 
 onUploadCreateFromRequest ( $type, &$className)
 This hook is called when UploadBase::createFromRequest has been called.
 
 onUploadForm_BeforeProcessing ( $upload)
 This hook is called at the beginning of processUpload().
 
 onUploadForm_getInitialPageText (&$pageText, $msg, $config)
 This hook is called after the initial page text for file uploads is generated.
 
 onUploadForm_initial ( $upload)
 This hook is called before the upload form is generated.
 
 onUploadFormInitDescriptor (&$descriptor)
 This hook is called after the descriptor for the upload form as been assembled.
 
 onUploadFormSourceDescriptors (&$descriptor, &$radio, $selectedSourceType)
 This hook is called after the standard source inputs have been added to the descriptor.
 
 onUploadStashFile ( $upload, $user, $props, &$error)
 
 onUploadVerifyFile ( $upload, $mime, &$error)
 Use this hook to perform extra file verification, based on MIME type, etc.
 
 onUploadVerifyUpload ( $upload, $user, $props, $comment, $pageText, &$error)
 
 onUser__mailPasswordInternal ( $user, $ip, $u)
 This hook is called before creation and mailing of a user's new temporary password.
 
 onUserAddGroup ( $user, &$group, &$expiry)
 This hook is called when adding a group or changing a group's expiry.
 
 onUserArrayFromResult (&$userArray, $res)
 This hook is called when creating an UserArray object from a database result.
 
 onUserCan ( $title, $user, $action, &$result)
 Use this hook to interrupt or advise the "user can do X to Y article" check.
 
 onUserCanSendEmail ( $user, &$hookErr)
 Use this hook to override User::canSendEmail() permission check.
 
 onUserClearNewTalkNotification ( $userIdentity, $oldid)
 This hook is called post-send when viewing a user talk page.
 
 onUserEditCountUpdate ( $infos)
 This is called from a deferred update on edit or move and provides collected user edit count information.
 
 onUserEffectiveGroups ( $user, &$groups)
 This hook is called in UserGroupManager::getUserEffectiveGroups().
 
 onUserGetAllRights (&$rights)
 This hook is called after calculating a list of all available rights.
 
 onUserGetDefaultOptions (&$defaultOptions)
 This hook is called after fetching core default user options but before returning the options.
 
 onUserGetEmail ( $user, &$email)
 This hook is called when getting an user email address.
 
 onUserGetEmailAuthenticationTimestamp ( $user, &$timestamp)
 This hook is called when getting the timestamp of email authentication.
 
 onUserGetLanguageObject ( $user, &$code, $context)
 This hook is called when getting a user's interface language object.
 
 onUserGetReservedNames (&$reservedUsernames)
 Use this hook to modify $wgReservedUsernames at run time.
 
 onUserGetRights ( $user, &$rights)
 This hook is called in PermissionManager::getUserPermissions().
 
 onUserGetRightsRemove ( $user, &$rights)
 This hook is called in PermissionManager::getUserPermissions().
 
 onUserGroupsChanged ( $user, $added, $removed, $performer, $reason, $oldUGMs, $newUGMs)
 This hook is called after user groups are changed.
 
 onUserIsBlockedFrom ( $user, $title, &$blocked, &$allowUsertalk)
 Use this hook to check if a user is blocked from a specific page (for specific block exemptions if a user is already blocked).
 
 onUserIsBlockedGlobally ( $user, $ip, &$blocked, &$block)
 Use this hook to establish that a user is blocked on all wikis.
 
 onUserIsBot ( $user, &$isBot)
 Use this hook to establish whether a user is a bot account.
 
 onUserIsEveryoneAllowed ( $right)
 Use this hook to check if all users are allowed some user right; return false if a UserGetRights hook might remove the named right.
 
 onUserIsLocked ( $user, &$locked)
 Use this hook to establish that a user is locked.
 
 onUserLoadAfterLoadFromSession ( $user)
 This hook is called to authenticate users on external or environmental means.
 
 onUserLoadDefaults ( $user, $name)
 This hook is called when loading a default user.
 
 onUserLoggedIn ( $user)
 This hook is called after a user is logged in.
 
 onUserLoginComplete ( $user, &$inject_html, $direct)
 Use this hook to show custom content after a user has logged in via the web interface.
 
 onUserLogout ( $user)
 This hook is called before a user logs out.
 
 onUserLogoutComplete ( $user, &$inject_html, $oldName)
 This hook is called after a user has logged out.
 
 onUserMailerChangeReturnPath ( $to, &$returnPath)
 This hook is called to generate a VERP return address when UserMailer sends an email, with a bounce handling extension.
 
 onUserMailerSplitTo (&$to)
 This hook is called in UserMailer::send() to give extensions a chance to split up an email with multiple To: fields into separate emails.
 
 onUserMailerTransformContent ( $to, $from, &$body, &$error)
 This hook is called in UserMailer::send() to change email contents.
 
 onUserMailerTransformMessage ( $to, $from, &$subject, &$headers, &$body, &$error)
 This hook is called in UserMailer::send() to change email after it has gone through the MIME transform.
 
 onUserPrivilegedGroups ( $userIdentity, &$groups)
 
 onUserRemoveGroup ( $user, &$group)
 This hook is called when removing a group.
 
 onUserSaveSettings ( $user)
 This hook is called directly after user settings have been saved to the database.
 
 onUserSendConfirmationMail ( $user, &$mail, $info)
 This hook is called just before a confirmation email is sent to a user.
 
 onUserSetEmail ( $user, &$email)
 This hook is called when changing user email address.
 
 onUserSetEmailAuthenticationTimestamp ( $user, &$timestamp)
 This hook is called when setting the timestamp of a User's email authentication.
 
 onUsersPagerDoBatchLookups ( $dbr, $userIds, &$cache, &$groups)
 This hook is called in UsersPager::doBatchLookups()
 
 onUserToolLinksEdit ( $userId, $userText, &$items)
 This hook is called when generating a list of user tool links, e.g.
 
 onValidateExtendedMetadataCache ( $timestamp, $file)
 Use this hook to validate the cached metadata in FormatMetadata::getExtendedMeta.
 
 onWantedPages__getQueryInfo ( $wantedPages, &$query)
 This hook is called in SpecialWantedPages::getQueryInfo().
 
 onWatchArticle ( $user, $page, &$status, $expiry)
 This hook is called before a watch is added to an article.
 
 onWatchArticleComplete ( $user, $page)
 This hook is called after a watch is added to an article.
 
 onWatchedItemQueryServiceExtensions (&$extensions, $watchedItemQueryService)
 Use this hook to create a WatchedItemQueryServiceExtension.
 
 onWatchlistEditorBeforeFormRender (&$watchlistInfo)
 This hook is called before building the Special:EditWatchlist form.
 
 onWatchlistEditorBuildRemoveLine (&$tools, $title, $redirect, $skin, &$link)
 This hook is called when building remove lines in Special:Watchlist/edit.
 
 onWebRequestPathInfoRouter ( $router)
 This hook is called while building the MediaWiki\Request\PathRouter to parse the REQUEST_URI.
 
 onWebResponseSetCookie (&$name, &$value, &$expire, &$options)
 This hook is called when setting a cookie in WebResponse::setcookie().
 
 onWfShellWikiCmd (&$script, &$parameters, &$options)
 This hook is called when generating a shell-escaped command line string to run a MediaWiki CLI script.
 
 onWgQueryPages (&$qp)
 This hook is called when initialising list of QueryPage subclasses.
 
 onWhatLinksHereProps ( $row, $title, $target, &$props)
 Use this hook to add annotations to Special:WhatLinksHere.
 
 onWikiExporter__dumpStableQuery (&$tables, &$opts, &$join)
 Use this hook to get the SELECT query for "stable" revisions dumps.
 
 onWikiPageDeletionUpdates ( $page, $content, &$updates)
 Use this hook to manipulate the list of DeferrableUpdates to be applied when a page is deleted.
 
 onWikiPageFactory ( $title, &$page)
 Use this hook to override WikiPage class used for a title.
 
 onXmlDumpWriterOpenPage ( $obj, &$out, $row, $title)
 This hook is called at the end of XmlDumpWriter::openPage, to allow extra metadata to be added.
 
 onXmlDumpWriterWriteRevision ( $obj, &$out, $row, $text, $rev)
 This hook is called at the end of a revision in an XML dump, to add extra metadata.
 
- Public Member Functions inherited from MediaWiki\Content\Hook\SearchDataForIndex2Hook
 onSearchDataForIndex2 (array &$fields, ContentHandler $handler, WikiPage $page, ParserOutput $output, SearchEngine $engine, RevisionRecord $revision)
 Use this hook to add data to search document.
 
- Public Member Functions inherited from MediaWiki\Specials\Contribute\Hook\ContributeCardsHook
 onContributeCards (array &$cards)
 This hook is called before processing the list of cards to display on the contribute page.
 
- Public Member Functions inherited from MediaWiki\Diff\Hook\TextSlotDiffRendererTablePrefixHook
 onTextSlotDiffRendererTablePrefix (TextSlotDiffRenderer $textSlotDiffRenderer, IContextSource $context, array &$parts)
 Use this hook to change the HTML that is included in a prefix container directly before the diff table.
 
- Public Member Functions inherited from MediaWiki\Hook\EditFilterMergedContentHook
 onEditFilterMergedContent (IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit)
 Use this hook for a post-section-merge edit filter.
 
- Public Member Functions inherited from MediaWiki\Hook\GetBlockErrorMessageKeyHook
 onGetBlockErrorMessageKey (Block $block, string &$key)
 This hook is called in BlockErrorFormatter to allow extensions to override the message that will be displayed to the user.
 
- Public Member Functions inherited from MediaWiki\Hook\SpecialExportGetExtraPagesHook
 onSpecialExportGetExtraPages (array $inputPages, array &$extraPages)
 Add extra pages to the list of pages to export.
 
- Public Member Functions inherited from MediaWiki\Hook\TitleMoveHook
 onTitleMove (Title $old, Title $nt, User $user, $reason, Status &$status)
 This hook is called before moving an article (title).
 
- Public Member Functions inherited from MediaWiki\Hook\UploadStashFileHook
 onUploadStashFile (UploadBase $upload, User $user, ?array $props, &$error)
 This hook is called before a file is stashed (uploaded to stash).
 
- Public Member Functions inherited from MediaWiki\Hook\UploadVerifyUploadHook
 onUploadVerifyUpload (UploadBase $upload, User $user, ?array $props, $comment, $pageText, &$error)
 Use this hook to perform upload verification, based on both file properties like MIME type (same as UploadVerifyFile) and the information entered by the user (upload comment, file page contents etc.).
 
- Public Member Functions inherited from MediaWiki\Page\Hook\ArticleDeleteHook
 onArticleDelete (WikiPage $wikiPage, User $user, &$reason, &$error, Status &$status, $suppress)
 This hook is called before an article is deleted.
 
- Public Member Functions inherited from MediaWiki\User\Hook\UserPrivilegedGroupsHook
 onUserPrivilegedGroups (UserIdentity $userIdentity, array &$groups)
 This hook is called in UserGroupManager::getUserPrivilegedGroups().
 

Detailed Description

This class provides an implementation of the core hook interfaces, forwarding hook calls to HookContainer for dispatch to extensions.

It is intended for use within MediaWiki core only. Extensions that need a hook runner should create one for the hooks they need to run.

To use it, create a new HookRunner object from a HookContainer obtained by dependency injection, or as a last resort, from the global service container. Then call the relevant method on the object: ( new HookRunner( $hookContainer ) )->onSomeHook( $param );

Access: internal

Definition at line 44 of file HookRunner.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\HookContainer\HookRunner::__construct ( HookContainer $container)

Definition at line 575 of file HookRunner.php.

Member Function Documentation

◆ onAbortAutoblock()

MediaWiki\HookContainer\HookRunner::onAbortAutoblock ( $autoblockip,
$block )

Use this hook to cancel an autoblock.

Since
1.35
Parameters
string$autoblockipIP going to be autoblocked
DatabaseBlock$blockBlock from which the autoblock is coming
Returns
bool|void True or no return value to continue, or false to cancel an autoblock

Implements MediaWiki\Block\Hook\AbortAutoblockHook.

Definition at line 579 of file HookRunner.php.

◆ onAbortDiffCache()

MediaWiki\HookContainer\HookRunner::onAbortDiffCache ( $diffEngine)

Use this hook to cancel the caching of a diff.

Since
1.35
Parameters
DifferenceEngine$diffEngine
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\AbortDiffCacheHook.

Definition at line 586 of file HookRunner.php.

◆ onAbortEmailNotification()

MediaWiki\HookContainer\HookRunner::onAbortEmailNotification ( $editor,
$title,
$rc )

Use this hook to cancel email notifications for an edit.

Since
1.35
Parameters
User$editorUser who made the change
Title$titleTitle of the page that was edited
RecentChange$rcCurrent RecentChange object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\AbortEmailNotificationHook.

Definition at line 593 of file HookRunner.php.

◆ onAbortTalkPageEmailNotification()

MediaWiki\HookContainer\HookRunner::onAbortTalkPageEmailNotification ( $targetUser,
$title )

Use this hook to disable email notifications of edits to users' talk pages.

Since
1.35
Parameters
User$targetUserUser whom to send talk page email notification
Title$titlePage title
Returns
bool|void True or no return value to continue, or false to cancel talk page email notification

Implements MediaWiki\Hook\AbortTalkPageEmailNotificationHook.

Definition at line 600 of file HookRunner.php.

◆ onActionBeforeFormDisplay()

MediaWiki\HookContainer\HookRunner::onActionBeforeFormDisplay ( $name,
$form,
$article )

This hook is called before executing the HTMLForm object.

Since
1.35
Parameters
string$nameName of the action
HTMLForm$form
Article$article
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ActionBeforeFormDisplayHook.

Definition at line 607 of file HookRunner.php.

◆ onActionModifyFormFields()

MediaWiki\HookContainer\HookRunner::onActionModifyFormFields ( $name,
& $fields,
$article )

This hook is called before creating an HTMLForm object for a page action.

Use this hook to change the fields on the form that will be generated.

Since
1.35
Parameters
string$nameName of the action
array&$fieldsHTMLForm descriptor array
Article$article
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ActionModifyFormFieldsHook.

Definition at line 614 of file HookRunner.php.

◆ onAddNewAccount()

MediaWiki\HookContainer\HookRunner::onAddNewAccount ( $user,
$byEmail )

This hook is called after a user account is created.

Since
1.35
Parameters
User$userthe User object that was created. (Parameter added in 1.7)
bool$byEmailtrue when account was created "by email" (added in 1.12)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\AddNewAccountHook.

Definition at line 621 of file HookRunner.php.

◆ onAfterBuildFeedLinks()

MediaWiki\HookContainer\HookRunner::onAfterBuildFeedLinks ( & $feedLinks)

This hook is called in OutputPage.php after all feed links (atom, rss,...) are created.

Use this hook to omit specific feeds from being outputted. You must not use this hook to add feeds; use OutputPage::addFeedLink() instead.

Since
1.35
Parameters
string[]&$feedLinksArray of created feed links
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Output\Hook\AfterBuildFeedLinksHook.

Definition at line 628 of file HookRunner.php.

◆ onAfterFinalPageOutput()

MediaWiki\HookContainer\HookRunner::onAfterFinalPageOutput ( $output)

This hook is called nearly at the end of OutputPage::output() but before OutputPage::sendCacheControl() and final ob_end_flush() which will send the buffered output to the client.

This allows for last-minute modification of the output within the buffer by using ob_get_clean().

Since
1.35
Parameters
OutputPage$outputThe OutputPage object where output() was called
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Output\Hook\AfterFinalPageOutputHook.

Definition at line 635 of file HookRunner.php.

◆ onAfterImportPage()

MediaWiki\HookContainer\HookRunner::onAfterImportPage ( $title,
$foreignTitle,
$revCount,
$sRevCount,
$pageInfo )

This hook is called when a page import is completed.

Since
1.35
Parameters
Title$titleTitle under which the revisions were imported
ForeignTitle$foreignTitleForeignTitle object based on data provided by the XML file
int$revCountNumber of revisions in the XML file
int$sRevCountNumber of successfully imported revisions
array$pageInfoAssociative array of page information
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\AfterImportPageHook.

Definition at line 643 of file HookRunner.php.

◆ onAfterParserFetchFileAndTitle()

MediaWiki\HookContainer\HookRunner::onAfterParserFetchFileAndTitle ( $parser,
$ig,
& $html )

This hook is called after an image gallery is formed by Parser, just before adding its HTML to parser output.

Since
1.35
Parameters
Parser$parserParser that called the hook
ImageGalleryBase$igGallery, an object of one of the gallery classes (inheriting from ImageGalleryBase)
string&$htmlHTML generated by the gallery
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\AfterParserFetchFileAndTitleHook.

Definition at line 652 of file HookRunner.php.

◆ onAlternateEdit()

MediaWiki\HookContainer\HookRunner::onAlternateEdit ( $editPage)

This hook is called before checking if a user can edit a page and before showing the edit form ( EditPage::edit() ).

This is triggered on &action=edit.

Since
1.35
Parameters
EditPage$editPage
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\AlternateEditHook.

Definition at line 659 of file HookRunner.php.

◆ onAlternateEditPreview()

MediaWiki\HookContainer\HookRunner::onAlternateEditPreview ( $editPage,
& $content,
& $previewHTML,
& $parserOutput )

This hook is called before generating the preview of the page when editing ( EditPage::getPreviewText() ).

Since
1.35
Parameters
EditPage$editPage
Content&$contentContent object for the text field from the edit page
string&$previewHTMLText to be placed into the page for the preview
ParserOutput&$parserOutputParserOutput object for the preview
Returns
bool|void True or no return value to continue, or false and set $previewHTML and $parserOutput to output custom page preview HTML

Implements MediaWiki\Hook\AlternateEditPreviewHook.

Definition at line 666 of file HookRunner.php.

◆ onAlternateUserMailer()

MediaWiki\HookContainer\HookRunner::onAlternateUserMailer ( $headers,
$to,
$from,
$subject,
$body )

This hook is called before mail is sent so that mail could be logged (or something else) instead of using PEAR or PHP's mail().

Since
1.35
Parameters
array$headersAssociative array of headers for the email
MailAddress | array$toTo address
MailAddress$fromFrom address
string$subjectSubject of the email
string$bodyBody of the message
Returns
bool|string|void True or no return value to continue sending email in the regular way, or false to skip the regular method of sending mail. Return a string to return a php-mail-error message containing the error.

Implements MediaWiki\Hook\AlternateUserMailerHook.

Definition at line 675 of file HookRunner.php.

◆ onAncientPagesQuery()

MediaWiki\HookContainer\HookRunner::onAncientPagesQuery ( & $tables,
& $conds,
& $joinConds )

Use this hook to modify the query used by Special:AncientPages.

Since
1.35
Parameters
array&$tablestables to join in the query
array&$condsconditions for the query
array&$joinCondsjoin conditions for the query
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\AncientPagesQueryHook.

Definition at line 682 of file HookRunner.php.

◆ onApiBeforeMain()

MediaWiki\HookContainer\HookRunner::onApiBeforeMain ( & $main)

This hook is called before calling ApiMain's execute() method in api.php.

Since
1.35
Parameters
ApiMain&$main
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ApiBeforeMainHook.

Definition at line 689 of file HookRunner.php.

◆ onArticle__MissingArticleConditions()

MediaWiki\HookContainer\HookRunner::onArticle__MissingArticleConditions ( & $conds,
$logTypes )

This hook is called before fetching deletion and move log entries to display a message of a non-existing page being deleted/moved.

Use this hook to hide unrelated log entries.

Since
1.35
Parameters
array&$condsArray of query conditions (all of which have to be met; conditions will AND in the final query)
string[]$logTypesArray of log types being queried
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\Article__MissingArticleConditionsHook.

Definition at line 872 of file HookRunner.php.

◆ onArticleConfirmDelete()

MediaWiki\HookContainer\HookRunner::onArticleConfirmDelete ( $article,
$output,
& $reason )

This hook is called before writing the confirmation form for article deletion.

Since
1.35
Parameters
Article$articleArticle being deleted
OutputPage$output
string&$reasonReason the article is being deleted
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleConfirmDeleteHook.

Definition at line 696 of file HookRunner.php.

◆ onArticleContentOnDiff()

MediaWiki\HookContainer\HookRunner::onArticleContentOnDiff ( $diffEngine,
$output )

This hook is called before showing the article content below a diff.

Use this hook to change the content in this area or how it is loaded.

Since
1.35
Parameters
DifferenceEngine$diffEngine
OutputPage$output
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\ArticleContentOnDiffHook.

Definition at line 703 of file HookRunner.php.

◆ onArticleDelete()

MediaWiki\HookContainer\HookRunner::onArticleDelete ( $wikiPage,
$user,
& $reason,
& $error,
& $status,
$suppress )

Definition at line 710 of file HookRunner.php.

◆ onArticleDeleteAfterSuccess()

MediaWiki\HookContainer\HookRunner::onArticleDeleteAfterSuccess ( $title,
$outputPage )

Use this hook to modify the output after an article has been deleted.

Since
1.35
Parameters
Title$titleArticle that has been deleted
OutputPage$outputPageOutputPage that can be used to append the output
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleDeleteAfterSuccessHook.

Definition at line 719 of file HookRunner.php.

◆ onArticleDeleteComplete()

MediaWiki\HookContainer\HookRunner::onArticleDeleteComplete ( $wikiPage,
$user,
$reason,
$id,
$content,
$logEntry,
$archivedRevisionCount )

This hook is called after an article is deleted.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage that was deleted. This object represents state before deletion (e.g. $wikiPage->exists() will return true).
User$userUser that deleted the article
string$reasonReason the article was deleted
int$idID of the article that was deleted
Content | null$contentContent of the deleted page (or null, when deleting a broken page)
ManualLogEntry$logEntryManualLogEntry used to record the deletion
int$archivedRevisionCountNumber of revisions archived during the deletion
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleDeleteCompleteHook.

Definition at line 726 of file HookRunner.php.

◆ onArticleEditUpdateNewTalk()

MediaWiki\HookContainer\HookRunner::onArticleEditUpdateNewTalk ( $wikiPage,
$recipient )

This hook is called before updating user_newtalk when a user talk page was changed.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage of the user talk page
User$recipientUser whose talk page was edited
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Storage\Hook\ArticleEditUpdateNewTalkHook.

Definition at line 736 of file HookRunner.php.

◆ onArticleFromTitle()

MediaWiki\HookContainer\HookRunner::onArticleFromTitle ( $title,
& $article,
$context )

This hook is called when creating an article object from a title object using Wiki::articleFromTitle().

Since
1.35
Parameters
Title$titleTitle used to create the article object
Article&$articleArticle that will be returned
IContextSource$context
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleFromTitleHook.

Definition at line 743 of file HookRunner.php.

◆ onArticleMergeComplete()

MediaWiki\HookContainer\HookRunner::onArticleMergeComplete ( $targetTitle,
$destTitle )

This hook is called after merging to article using Special:Mergehistory.

Since
1.35
Parameters
Title$targetTitle
Title$destTitleDestination title
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ArticleMergeCompleteHook.

Definition at line 750 of file HookRunner.php.

◆ onArticlePageDataAfter()

MediaWiki\HookContainer\HookRunner::onArticlePageDataAfter ( $wikiPage,
& $row )

This hook is called after loading data of an article from the database.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage whose data were loaded
stdClass&$rowRow returned from the database server
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticlePageDataAfterHook.

Definition at line 757 of file HookRunner.php.

◆ onArticlePageDataBefore()

MediaWiki\HookContainer\HookRunner::onArticlePageDataBefore ( $wikiPage,
& $fields,
& $tables,
& $joinConds )

This hook is called before loading data of an article from the database.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage whose data will be loaded
array&$fieldsFields to load from the database
array&$tablesTables to load from the database
array&$joinCondsJoin conditions to load from the database
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticlePageDataBeforeHook.

Definition at line 764 of file HookRunner.php.

◆ onArticleParserOptions()

MediaWiki\HookContainer\HookRunner::onArticleParserOptions ( Article $article,
ParserOptions $popts )

This hook is called before parsing wikitext for an article, and allows setting particular parser options based on title, user preferences, etc.

Since
1.36
Parameters
Article$articleArticle about to be parsed
ParserOptions$poptsMutable parser options
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleParserOptionsHook.

Definition at line 773 of file HookRunner.php.

◆ onArticlePrepareTextForEdit()

MediaWiki\HookContainer\HookRunner::onArticlePrepareTextForEdit ( $wikiPage,
$popts )

This hook is called when preparing text to be saved.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage being saved
ParserOptions$poptsParser options to be used for pre-save transformation
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Storage\Hook\ArticlePrepareTextForEditHook.

Definition at line 780 of file HookRunner.php.

◆ onArticleProtect()

MediaWiki\HookContainer\HookRunner::onArticleProtect ( $wikiPage,
$user,
$protect,
$reason )

This hook is called before an article is protected.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage being protected
User$userUser doing the protection
array$protectSet of restriction keys
string$reasonReason for protect
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleProtectHook.

Definition at line 787 of file HookRunner.php.

◆ onArticleProtectComplete()

MediaWiki\HookContainer\HookRunner::onArticleProtectComplete ( $wikiPage,
$user,
$protect,
$reason )

This hook is called after an article is protected.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage that was protected
User$userUser who did the protection
array$protectSet of restriction keys
string$reasonReason for protect
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleProtectCompleteHook.

Definition at line 794 of file HookRunner.php.

◆ onArticlePurge()

MediaWiki\HookContainer\HookRunner::onArticlePurge ( $wikiPage)

This hook is called before executing "&action=purge".

Since
1.35
Parameters
WikiPage$wikiPageWikiPage to purge
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticlePurgeHook.

Definition at line 801 of file HookRunner.php.

◆ onArticleRevisionViewCustom()

MediaWiki\HookContainer\HookRunner::onArticleRevisionViewCustom ( $revision,
$title,
$oldid,
$output )

Use this hook for custom rendering of an article's content.

Note that it is preferable to implement proper handing for a custom data type using the ContentHandler facility.

Since
1.35
Parameters
RevisionRecord | null$revisionContent of the page (or null if the revision could not be loaded). May also be a fake that wraps content supplied by an extension.
Title$titleTitle of the page
int$oldidRequested revision ID, or 0 for the current revision
OutputPage$output
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleRevisionViewCustomHook.

Definition at line 808 of file HookRunner.php.

◆ onArticleRevisionVisibilitySet()

MediaWiki\HookContainer\HookRunner::onArticleRevisionVisibilitySet ( $title,
$ids,
$visibilityChangeMap )

This hook is called when changing visibility of one or more revisions of an article.

Since
1.35
Parameters
Title$titleTitle of the article
int[]$idsIDs to set the visibility for
array$visibilityChangeMapMap of revision ID to oldBits and newBits. This array can be examined to determine exactly what visibility bits have changed for each revision. This array is of the form: [id => ['oldBits' => $oldBits, 'newBits' => $newBits], ... ]
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ArticleRevisionVisibilitySetHook.

Definition at line 817 of file HookRunner.php.

◆ onArticleShowPatrolFooter()

MediaWiki\HookContainer\HookRunner::onArticleShowPatrolFooter ( $article)

This hook is called at the beginning of Article::showPatrolFooter.

Use this hook to not show the [mark as patrolled] link in certain circumstances.

Since
1.35
Parameters
Article$article
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleShowPatrolFooterHook.

Definition at line 826 of file HookRunner.php.

◆ onArticleUndelete()

MediaWiki\HookContainer\HookRunner::onArticleUndelete ( $title,
$create,
$comment,
$oldPageId,
$restoredPages )

This hook is called when one or more revisions of an article are restored.

Since
1.35
Parameters
Title$titleTitle corresponding to the article restored
bool$createWhether or not the restoration caused the page to be created (i.e. it didn't exist before)
string$commentComment associated with the undeletion
int$oldPageIdID of page previously deleted (from archive table). This ID will be used for the restored page.
array$restoredPagesSet of page IDs that have revisions restored for this undelete, with keys set to page IDs and values set to 'true'
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleUndeleteHook.

Definition at line 833 of file HookRunner.php.

◆ onArticleUpdateBeforeRedirect()

MediaWiki\HookContainer\HookRunner::onArticleUpdateBeforeRedirect ( $article,
& $sectionanchor,
& $extraq )

This hook is called after a page is updated (usually on save), before the user is redirected back to the page.

Since
1.35
Parameters
Article$article
string&$sectionanchorSection anchor link (e.g. "#overview" )
string&$extraqExtra query parameters which can be added via hooked functions
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ArticleUpdateBeforeRedirectHook.

Definition at line 842 of file HookRunner.php.

◆ onArticleViewFooter()

MediaWiki\HookContainer\HookRunner::onArticleViewFooter ( $article,
$patrolFooterShown )

This hook is called after showing the footer section of an ordinary page view.

Since
1.35
Parameters
Article$article
bool$patrolFooterShownWhether patrol footer is shown
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleViewFooterHook.

Definition at line 851 of file HookRunner.php.

◆ onArticleViewHeader()

MediaWiki\HookContainer\HookRunner::onArticleViewHeader ( $article,
& $outputDone,
& $pcache )

Use this hook to control article output.

This hook is called before the parser cache is about to be tried for article viewing.

Since
1.35
Parameters
Article$article
bool | ParserOutput | null&$outputDoneWhether the output for this page finished or not. Set to a ParserOutput object to both indicate that the output is done and what parser output was used.
bool&$pcacheWhether to try the parser cache or not
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleViewHeaderHook.

Definition at line 858 of file HookRunner.php.

◆ onArticleViewRedirect()

MediaWiki\HookContainer\HookRunner::onArticleViewRedirect ( $article)

This hook is called before setting "Redirected from ..." subtitle when a redirect was followed.

Since
1.35
Parameters
Article$articleTarget article
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ArticleViewRedirectHook.

Definition at line 865 of file HookRunner.php.

◆ onAuthChangeFormFields()

MediaWiki\HookContainer\HookRunner::onAuthChangeFormFields ( $requests,
$fieldInfo,
& $formDescriptor,
$action )

This hook is called after converting a field information array obtained from a set of AuthenticationRequest classes into a form descriptor; hooks can tweak the array to change how login etc.

forms should look.

Since
1.35
Parameters
AuthenticationRequest[]$requestsArray of AuthenticationRequests the fields are created from
array$fieldInfoField information array (union of all AuthenticationRequest::getFieldInfo() responses)
array&$formDescriptorHTMLForm descriptor. The special key 'weight' can be set to change the order of the fields.
string$actionOne of the AuthManager::ACTION_* constants
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\AuthChangeFormFieldsHook.

Definition at line 879 of file HookRunner.php.

◆ onAuthManagerLoginAuthenticateAudit()

MediaWiki\HookContainer\HookRunner::onAuthManagerLoginAuthenticateAudit ( $response,
$user,
$username,
$extraData )

This hook is called when a login attempt either succeeds or fails for a reason other than misconfiguration or session loss.

No return data is accepted; this hook is for auditing only.

Since
1.35
Parameters
AuthenticationResponse$responseResponse in either a PASS or FAIL state
User | null$userUser being authenticated against, or null if authentication failed before getting that far
string | null$usernameA guess at the username being authenticated, or null if we can't even determine that. When $user is not null, it can be in the form of <username><more info> (e.g. for bot passwords).
string[]$extraDataArray (string => string) with extra information, intended to be added to log contexts. Fields it might include:
  • appId: application ID, only if the login was with a bot password
  • performer: the user performing the login authentication request
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Auth\Hook\AuthManagerLoginAuthenticateAuditHook.

Definition at line 888 of file HookRunner.php.

◆ onAutopromoteCondition()

MediaWiki\HookContainer\HookRunner::onAutopromoteCondition ( $type,
$args,
$user,
& $result )

Use this hook to check autopromote condition for user.

Since
1.35
Parameters
string$typeCondition type
array$argsArguments
User$user
array&$resultResult of checking autopromote condition
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\AutopromoteConditionHook.

Definition at line 897 of file HookRunner.php.

◆ onBacklinkCacheGetConditions()

MediaWiki\HookContainer\HookRunner::onBacklinkCacheGetConditions ( $table,
$title,
& $conds )

Use this hook to set conditions for query when links to certain title are fetched.

Since
1.35
Parameters
string$tableTable name
Title$titleTitle of the page to which backlinks are sought
array&$condsQuery conditions
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\BacklinkCacheGetConditionsHook.

Definition at line 904 of file HookRunner.php.

◆ onBacklinkCacheGetPrefix()

MediaWiki\HookContainer\HookRunner::onBacklinkCacheGetPrefix ( $table,
& $prefix )

Use this hook to set a prefix for a specific link table.

Since
1.35
Parameters
string$tableTable name
string&$prefix
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\BacklinkCacheGetPrefixHook.

Definition at line 911 of file HookRunner.php.

◆ onBadImage()

MediaWiki\HookContainer\HookRunner::onBadImage ( $name,
& $bad )

This hook is called when checking against the bad image list.

If an image is "bad", it is not rendered inline in wiki pages or galleries in category pages.

Since
1.35
Parameters
string$nameImage name being checked
bool&$badWhether or not the image is "bad"
Returns
bool|void True or no return value to continue, or false and change $bad to override

Implements MediaWiki\Hook\BadImageHook.

Definition at line 918 of file HookRunner.php.

◆ onBeforeDisplayNoArticleText()

MediaWiki\HookContainer\HookRunner::onBeforeDisplayNoArticleText ( $article)

This hook is called before displaying message key "noarticletext" or "noarticletext-nopermission" at Article::showMissingArticle().

Since
1.35
Parameters
Article$article
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\BeforeDisplayNoArticleTextHook.

Definition at line 925 of file HookRunner.php.

◆ onBeforeInitialize()

MediaWiki\HookContainer\HookRunner::onBeforeInitialize ( $title,
$unused,
$output,
$user,
$request,
$mediaWikiEntryPoint )

This hook is called before anything is initialized in ActionEntryPoint::performRequest().

Since
1.35
Parameters
Title$titleTitle being used for request
null$unused
OutputPage$output
User$user
WebRequest$request
ActionEntryPoint$mediaWikiEntryPoint(changed from MediaWiki to MediaWikiEntryPoint in MW 1.42)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BeforeInitializeHook.

Definition at line 932 of file HookRunner.php.

◆ onBeforePageDisplay()

MediaWiki\HookContainer\HookRunner::onBeforePageDisplay ( $out,
$skin )

This hook is called prior to outputting a page.

Since
1.35
Parameters
OutputPage$out
Skin$skin
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Output\Hook\BeforePageDisplayHook.

Definition at line 941 of file HookRunner.php.

◆ onBeforePageRedirect()

MediaWiki\HookContainer\HookRunner::onBeforePageRedirect ( $out,
& $redirect,
& $code )

This hook is called prior to sending an HTTP redirect.

Gives a chance to override how the redirect is output by modifying, or by returning false and taking over the output.

Since
1.35
Parameters
OutputPage$out
string&$redirectAbsolute or path-relative URL, modifiable
string&$codeHTTP code (eg '301' or '302'), modifiable
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Output\Hook\BeforePageRedirectHook.

Definition at line 949 of file HookRunner.php.

◆ onBeforeParserFetchFileAndTitle()

MediaWiki\HookContainer\HookRunner::onBeforeParserFetchFileAndTitle ( $parser,
$nt,
& $options,
& $descQuery )

This hook is called before an image is rendered by Parser.

Since
1.35
Parameters
Parser$parser
Title$ntImage title
array&$optionsArray of options to RepoGroup::findFile. If it contains 'broken' as a key then the file will appear as a broken thumbnail. If it contains private as a key, the value must be an Authority object.
string&$descQueryQuery string to add to thumbnail URL
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BeforeParserFetchFileAndTitleHook.

Definition at line 956 of file HookRunner.php.

◆ onBeforeParserFetchTemplateRevisionRecord()

MediaWiki\HookContainer\HookRunner::onBeforeParserFetchTemplateRevisionRecord ( ?LinkTarget $contextTitle,
LinkTarget $title,
bool & $skip,
?RevisionRecord & $revRecord )

This hook is called before a template is fetched by Parser.

It allows redirection of the title and/or revision id of the template. For example: the template could be redirected to an appropriately localized version of the template; or the template fetch could be redirected to a 'stable revision' of the template. If the returned RevisionRecord does not exist, its title will be added to the page dependencies and then this hook will be invoked again to resolve that title. This allows for fallback chains (of limited length).

Since
1.36
Parameters
?LinkTarget$contextTitleThe top-level page title, if any
LinkTarget$titleThe template link (from the literal wikitext)
bool&$skipSkip this template and link it?
?RevisionRecord&$revRecordThe desired revision record
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BeforeParserFetchTemplateRevisionRecordHook.

Definition at line 965 of file HookRunner.php.

◆ onBeforeRevertedTagUpdate()

MediaWiki\HookContainer\HookRunner::onBeforeRevertedTagUpdate ( $wikiPage,
$user,
$summary,
$flags,
$revisionRecord,
$editResult,
& $approved )

This hook is called before scheduling a RevertedTagUpdateJob.

Various content management extensions that involve some kind of approval mechanism for edits can use this to indicate that the RevertedTagUpdate should not be performed right after the edit is made, but rather it should wait for the edit to be approved. To delay the execution of the update simply implement this hook and set the $approved parameter to false when the user does not have an "autoreview" user right or similar.

The update can be later rescheduled using RevertedTagUpdateManager. In your code that marks an edit as "approved" use:

$revertedTagUpdateManager =
MediaWikiServices::getInstance()->getRevertedTagUpdateManager();
$revertedTagUpdateManager->approveRevertedTagForRevision( $acceptedRevisionId );

And that's it.

There should be no adverse effects due to enqueueing the same update multiple times.

Since
1.36
Parameters
WikiPage$wikiPageWikiPage modified
UserIdentity$userUser performing the modification
CommentStoreComment$summaryEdit summary/comment
int$flagsFlags passed to WikiPage::doUserEditContent()
RevisionRecord$revisionRecordNew RevisionRecord of the article
EditResult$editResultObject storing information about the effects of this edit, including which edits were reverted and which edit is this based on (for reverts and null edits).
bool&$approvedWhether the edit is considered approved. Setting it to false will abort the update, true will cause the update to be executed normally. If patrolling is enabled, the passed value will indicate whether the edit is autopatrolled or not. In case patrolling is disabled on the wiki, the passed value will always be true, unless modified by other extensions.
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Storage\Hook\BeforeRevertedTagUpdateHook.

Definition at line 975 of file HookRunner.php.

◆ onBeforeWelcomeCreation()

MediaWiki\HookContainer\HookRunner::onBeforeWelcomeCreation ( & $welcome_creation_msg,
& $injected_html )

This hook is called before the welcomecreation message is displayed to a newly created user.

Since
1.35
Parameters
string&$welcome_creation_msgMediaWiki message name to display on the welcome screen to a newly created user account.
string&$injected_htmlAny HTML to inject after the "logged in" message of a newly created user account
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BeforeWelcomeCreationHook.

Definition at line 986 of file HookRunner.php.

◆ onBitmapHandlerCheckImageArea()

MediaWiki\HookContainer\HookRunner::onBitmapHandlerCheckImageArea ( $image,
& $params,
& $checkImageAreaHookResult )

This hook is called by BitmapHandler::normaliseParams, after all normalizations have been performed, except for the $wgMaxImageArea check.

Since
1.35
Parameters
File$image
array&$paramsArray of parameters
bool | null&$checkImageAreaHookResultSet to true or false to override the $wgMaxImageArea check result
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BitmapHandlerCheckImageAreaHook.

Definition at line 995 of file HookRunner.php.

References $params.

◆ onBitmapHandlerTransform()

MediaWiki\HookContainer\HookRunner::onBitmapHandlerTransform ( $handler,
$image,
& $scalerParams,
& $mto )

This hook is called before a file is transformed, giving extensions the possibility to transform it themselves.

Since
1.35
Parameters
TransformationalImageHandler$handler
File$image
array&$scalerParamsArray with scaler parameters
null | MediaTransformOutput&$mto
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BitmapHandlerTransformHook.

Definition at line 1004 of file HookRunner.php.

◆ onBlockIp()

MediaWiki\HookContainer\HookRunner::onBlockIp ( $block,
$user,
& $reason )

This hook is called before an IP address or user is blocked.

Since
1.35
Parameters
DatabaseBlock$blockthe Block object about to be saved
User$userthe user doing the block (not the one being blocked)
array&$reasonif the hook is aborted, the error message to be returned in an array
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BlockIpHook.

Definition at line 1013 of file HookRunner.php.

◆ onBlockIpComplete()

MediaWiki\HookContainer\HookRunner::onBlockIpComplete ( $block,
$user,
$priorBlock )

This hook is called after an IP address or user is blocked.

Since
1.35
Parameters
DatabaseBlock$blockthe block object that was saved
User$userthe user who did the block (not the one being blocked)
?DatabaseBlock$priorBlockthe block object for the prior block, if there was one
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BlockIpCompleteHook.

Definition at line 1020 of file HookRunner.php.

◆ onBookInformation()

MediaWiki\HookContainer\HookRunner::onBookInformation ( $isbn,
$output )

This hook is called before information output on Special:Booksources.

Since
1.35
Parameters
string$isbnISBN to show information for
OutputPage$outputOutputPage object in use
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\BookInformationHook.

Definition at line 1027 of file HookRunner.php.

◆ onCanonicalNamespaces()

MediaWiki\HookContainer\HookRunner::onCanonicalNamespaces ( & $namespaces)

Use this hook to add namespaces or alter the defaults.

Note that if you need to specify namespace protection or content model for a namespace that is added in a CanonicalNamespaces hook handler, you should do so by altering $wgNamespaceProtection and $wgNamespaceContentModels outside the handler, in top-level scope. The point at which the CanonicalNamespaces hook fires is too late for altering these variables. This applies even if the namespace addition is conditional; it is permissible to declare a content model and protection for a namespace and then decline to actually register it.

Since
1.35
Parameters
string[]&$namespacesArray of namespace numbers with corresponding canonical names
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\CanonicalNamespacesHook.

Definition at line 1034 of file HookRunner.php.

◆ onCategoryAfterPageAdded()

MediaWiki\HookContainer\HookRunner::onCategoryAfterPageAdded ( $category,
$wikiPage )

This hook is called after a page is added to a category.

Since
1.35
Parameters
Category$categoryCategory that page was added to
WikiPage$wikiPageWikiPage that was added
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\CategoryAfterPageAddedHook.

Definition at line 1041 of file HookRunner.php.

◆ onCategoryAfterPageRemoved()

MediaWiki\HookContainer\HookRunner::onCategoryAfterPageRemoved ( $category,
$wikiPage,
$id )

This hook is called after a page is removed from a category.

Since
1.35
Parameters
Category$categoryCategory that page was removed from
WikiPage$wikiPageWikiPage that was removed
int$idPage ID (original ID in case of page deletions)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\CategoryAfterPageRemovedHook.

Definition at line 1048 of file HookRunner.php.

◆ onCategoryPageView()

MediaWiki\HookContainer\HookRunner::onCategoryPageView ( $catpage)

This hook is called before viewing a categorypage in CategoryPage::view.

Since
1.35
Parameters
CategoryPage$catpage
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\CategoryPageViewHook.

Definition at line 1055 of file HookRunner.php.

◆ onCategoryViewer__doCategoryQuery()

MediaWiki\HookContainer\HookRunner::onCategoryViewer__doCategoryQuery ( $type,
$res )

This hook is called after querying for pages to be displayed in a Category page.

Use this hook to batch load any related data about the pages.

Since
1.35
Parameters
string$typeCategory type, either 'page', 'file', or 'subcat'
IResultWrapper$resQuery result from Wikimedia\Rdbms\IDatabase::select()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\CategoryViewer__doCategoryQueryHook.

Definition at line 1062 of file HookRunner.php.

◆ onCategoryViewer__generateLink()

MediaWiki\HookContainer\HookRunner::onCategoryViewer__generateLink ( $type,
$title,
$html,
& $link )

This hook is called before generating an output link allow extensions opportunity to generate a more specific or relevant link.

Since
1.35
Parameters
string$typeCategory type, either 'page', 'file', or 'subcat'
Title$titleCategorized page
string$htmlRequested HTML content of anchor
string&$linkReturned value. When set to a non-null value by a hook subscriber, this value will be used as the anchor instead of LinkRenderer::makeLink.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\CategoryViewer__generateLinkHook.

Definition at line 1069 of file HookRunner.php.

◆ onChangeAuthenticationDataAudit()

MediaWiki\HookContainer\HookRunner::onChangeAuthenticationDataAudit ( $req,
$status )

This hook is called when a user changes their password.

No return data is accepted; this hook is for auditing only.

Since
1.35
Parameters
AuthenticationRequest$reqObject describing the change (and target user)
StatusValue$statusStatusValue with the result of the action
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\ChangeAuthenticationDataAuditHook.

Definition at line 1076 of file HookRunner.php.

◆ onChangesListInitRows()

MediaWiki\HookContainer\HookRunner::onChangesListInitRows ( $changesList,
$rows )

Use this hook to batch process change list rows prior to rendering.

Since
1.35
Parameters
ChangesList$changesList
IResultWrapper | \\stdClass[]$rowsData that will be rendered
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ChangesListInitRowsHook.

Definition at line 1083 of file HookRunner.php.

◆ onChangesListInsertArticleLink()

MediaWiki\HookContainer\HookRunner::onChangesListInsertArticleLink ( $changesList,
& $articlelink,
& $s,
$rc,
$unpatrolled,
$watched )

Use this hook to override or augment link to article in RC list.

Since
1.35
Parameters
ChangesList$changesList
string&$articlelinkHTML of link to article (already filled-in)
string&$sHTML of row that is being constructed
RecentChange$rc
bool$unpatrolledWhether or not we are showing unpatrolled changes
bool$watchedWhether or not the change is watched by the user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ChangesListInsertArticleLinkHook.

Definition at line 1090 of file HookRunner.php.

◆ onChangesListSpecialPageQuery()

MediaWiki\HookContainer\HookRunner::onChangesListSpecialPageQuery ( $name,
& $tables,
& $fields,
& $conds,
& $query_options,
& $join_conds,
$opts )

This hook is called when building an SQL query on pages inheriting from ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked and Watchlist).

Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure. Instead, use sub-classes of those classes in conjunction with the ChangesListSpecialPageStructuredFilters hook. This hook can be used to implement filters that do not implement that structure or custom behavior that is not an individual filter.

Since
1.35
Parameters
string$nameName of the special page, e.g. 'Watchlist'
array&$tablesArray of tables to be queried
array&$fieldsArray of columns to select
array&$condsArray of WHERE conditionals for query
array&$query_optionsArray of options for the database request
array&$join_condsJoin conditions for the tables
FormOptions$optsFormOptions for this request
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\ChangesListSpecialPageQueryHook.

Definition at line 1099 of file HookRunner.php.

◆ onChangesListSpecialPageStructuredFilters()

MediaWiki\HookContainer\HookRunner::onChangesListSpecialPageStructuredFilters ( $special)

Use this hook to register filters for pages inheriting from ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked, and Watchlist).

Generally, you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects. When constructing them, you specify which group they belong to. You can reuse existing groups (accessed through $special->getFilterGroup), or create your own (ChangesListBooleanFilterGroup or ChangesListStringOptionsFilterGroup). If you create new groups, you must register them with $special->registerFilterGroup. Note that this is called regardless of whether the user is currently using the new (structured) or old (unstructured) filter UI. If you want your boolean filter to show on both the new and old UI, specify all the supported fields. These include showHide, label, and description. See the constructor of each ChangesList* class for documentation of supported fields.

Since
1.35
Parameters
ChangesListSpecialPage$special
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\ChangesListSpecialPageStructuredFiltersHook.

Definition at line 1109 of file HookRunner.php.

◆ onChangeTagAfterDelete()

MediaWiki\HookContainer\HookRunner::onChangeTagAfterDelete ( $tag,
& $status )

This hook is called after a change tag has been deleted (that is, removed from all revisions and log entries to which it was applied).

This gives extensions a chance to take it off their books.

Since
1.35
Parameters
string$tagName of the tag
Status&$statusAdd warnings to this as required. There is no point setting errors, as the deletion has already been partly carried out by this point.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\ChangeTags\Hook\ChangeTagAfterDeleteHook.

Definition at line 1116 of file HookRunner.php.

◆ onChangeTagCanCreate()

MediaWiki\HookContainer\HookRunner::onChangeTagCanCreate ( $tag,
$user,
& $status )

Use this hook to tell whether a change tag should be able to be created from the UI (Special:Tags) or via the API.

You could use this hook if you want to reserve a specific "namespace" of tags, or something similar.

Since
1.35
Parameters
string$tagName of the tag
User | null$userUser initiating the action
Status&$statusAdd your errors using $status->fatal() or warnings using $status->warning(). Errors and warnings will be relayed to the user. If you set an error, the user will be unable to create the tag.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\ChangeTags\Hook\ChangeTagCanCreateHook.

Definition at line 1123 of file HookRunner.php.

◆ onChangeTagCanDelete()

MediaWiki\HookContainer\HookRunner::onChangeTagCanDelete ( $tag,
$user,
& $status )

Use this hook to tell whether a change tag should be able to be deleted from the UI (Special:Tags) or via the API.

The default is that tags defined using the ListDefinedTags hook are not allowed to be deleted unless specifically allowed. Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions.

Since
1.35
Parameters
string$tagName of the tag
User | null$userUser initiating the action
Status&$statusTo allow deletion of the tag, set $status = Status::newGood(), and then return false from the hook function.
Returns
bool|void True or no return value to continue or false to allow deletion of the tag

Implements MediaWiki\ChangeTags\Hook\ChangeTagCanDeleteHook.

Definition at line 1130 of file HookRunner.php.

◆ onChangeTagsAfterUpdateTags()

MediaWiki\HookContainer\HookRunner::onChangeTagsAfterUpdateTags ( $addedTags,
$removedTags,
$prevTags,
$rc_id,
$rev_id,
$log_id,
$params,
$rc,
$user )

This hook is called after tags have been updated with the ChangeTags::updateTags function.

Since
1.35
Parameters
string[]$addedTagsTags effectively added in the update
string[]$removedTagsTags effectively removed in the update
string[]$prevTagsTags that were present prior to the update
int$rc_idRecentchanges table id
int$rev_idRevision table id
int$log_idLogging table id
string | null$paramsTag params
RecentChange | null$rcRecentChange being tagged when the tagging accompanies the action, or null
User | null$userUser who performed the tagging when the tagging is subsequent to the action, or null
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\ChangeTags\Hook\ChangeTagsAfterUpdateTagsHook.

Definition at line 1137 of file HookRunner.php.

References $params.

◆ onChangeTagsAllowedAdd()

MediaWiki\HookContainer\HookRunner::onChangeTagsAllowedAdd ( & $allowedTags,
$addTags,
$user )

This hook is called when checking if a user can add tags to a change.

Since
1.35
Parameters
string[]&$allowedTagsList of all the tags the user is allowed to add. Any tags the user wants to add ($addTags) that are not in this array will cause it to fail. You may add or remove tags to this array as required.
string[]$addTagsList of tags user intends to add
User | null$userUser who is adding the tags
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\ChangeTags\Hook\ChangeTagsAllowedAddHook.

Definition at line 1147 of file HookRunner.php.

◆ onChangeTagsListActive()

MediaWiki\HookContainer\HookRunner::onChangeTagsListActive ( & $tags)

Use this hook to nominate which of the tags your extension uses are in active use.

Since
1.35
Parameters
string[]&$tagsList of all active tags. Append to this array.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\ChangeTags\Hook\ChangeTagsListActiveHook.

Definition at line 1154 of file HookRunner.php.

Referenced by MediaWiki\ChangeTags\ChangeTagsStore\listSoftwareActivatedTags().

◆ onChangeUserGroups()

MediaWiki\HookContainer\HookRunner::onChangeUserGroups ( $performer,
$user,
& $add,
& $remove )

This hook is called before user groups are changed.

Since
1.35
Parameters
User$performerThe User who will perform the change
User | UserIdentity$userThe User whose groups will be changed, for local group changes this is a User class, for interwiki group changes this was a UserRightsProxy until 1.40 and is a UserIdentity since 1.41
array&$addThe groups that will be added
array&$removeThe groups that will be removed
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ChangeUserGroupsHook.

Definition at line 1161 of file HookRunner.php.

◆ onCollation__factory()

MediaWiki\HookContainer\HookRunner::onCollation__factory ( $collationName,
& $collationObject )

This hook is called if $wgCategoryCollation is an unknown collation.

Since
1.35
Parameters
string$collationNameName of the collation in question
Collation | null&$collationObjectNull. Replace with a subclass of the Collation class that implements the collation given in $collationName.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\Collation__factoryHook.

Definition at line 1168 of file HookRunner.php.

◆ onConfirmEmailComplete()

MediaWiki\HookContainer\HookRunner::onConfirmEmailComplete ( $user)

This hook is called after a user's email has been confirmed successfully.

Since
1.35
Parameters
User$userUser whose email is being confirmed
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\ConfirmEmailCompleteHook.

Definition at line 1175 of file HookRunner.php.

◆ onContentAlterParserOutput()

MediaWiki\HookContainer\HookRunner::onContentAlterParserOutput ( $content,
$title,
$parserOutput )

Use this hook to modify parser output for a given content object.

This hook is called by Content::getParserOutput after parsing has finished. Can be used for changes that depend on the result of the parsing but have to be done before LinksUpdate is called (such as adding tracking categories based on the rendered HTML).

Since
1.35
Parameters
Content$contentContent to render
Title$titleTitle of the page, as context
ParserOutput$parserOutputParserOutput to manipulate
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\ContentAlterParserOutputHook.

Definition at line 1182 of file HookRunner.php.

◆ onContentGetParserOutput()

MediaWiki\HookContainer\HookRunner::onContentGetParserOutput ( $content,
$title,
$revId,
$options,
$generateHtml,
& $parserOutput )

Use this hook to customize parser output for a given content object.

This hook is called by AbstractContent::getParserOutput. May be used to override the normal model-specific rendering of page content.

Since
1.35
Parameters
Content$contentContent to render
Title$titleTitle of the page, as context
int$revIdRevision ID, as context
ParserOptions$optionsParserOptions for rendering. To avoid confusing the parser cache, the output can only depend on parameters provided to this hook function, not on global state.
bool$generateHtmlWhether full HTML should be generated. If false, generation of HTML may be skipped, but other information should still be present in the ParserOutput object.
ParserOutput&$parserOutputParserOutput to manipulate or replace
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\ContentGetParserOutputHook.

Definition at line 1189 of file HookRunner.php.

◆ onContentHandlerDefaultModelFor()

MediaWiki\HookContainer\HookRunner::onContentHandlerDefaultModelFor ( $title,
& $model )

This hook is called when the default content model is determined for a given title.

Use this hook to assign a different model for that title.

Since
1.35
Parameters
Title$titleTitle in question
string&$modelModel name. Use with CONTENT_MODEL_XXX constants.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Revision\Hook\ContentHandlerDefaultModelForHook.

Definition at line 1198 of file HookRunner.php.

◆ onContentHandlerForModelID()

MediaWiki\HookContainer\HookRunner::onContentHandlerForModelID ( $modelName,
& $handler )

This hook is called when a ContentHandler is requested for a given content model name, but no entry for that model exists in $wgContentHandlers.

Note: if your extension implements additional models via this hook, please use GetContentModels hook to make them known to core.

Since
1.35
Parameters
string$modelNameRequested content model name
ContentHandler&$handlerSet this to a ContentHandler object, if desired
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\ContentHandlerForModelIDHook.

Definition at line 1205 of file HookRunner.php.

◆ onContentModelCanBeUsedOn()

MediaWiki\HookContainer\HookRunner::onContentModelCanBeUsedOn ( $contentModel,
$title,
& $ok )

Use this hook to determine whether a content model can be used on a given page.

This is especially useful to prevent some content models from being used in a certain location.

Since
1.35
Parameters
string$contentModelContent model ID
Title$title
bool&$okWhether it is OK to use $contentModel on $title. Handler functions that modify $ok should generally return false to prevent the remaining hooks from further modifying $ok.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\ContentModelCanBeUsedOnHook.

Definition at line 1212 of file HookRunner.php.

◆ onContentSecurityPolicyDefaultSource()

MediaWiki\HookContainer\HookRunner::onContentSecurityPolicyDefaultSource ( & $defaultSrc,
$policyConfig,
$mode )

Use this hook to modify the allowed CSP load sources.

This affects all directives except for the script directive. To add a script source, see ContentSecurityPolicyScriptSource hook.

Since
1.35
Parameters
string[]&$defaultSrcArray of Content-Security-Policy allowed sources
array$policyConfigCurrent configuration for the Content-Security-Policy header
int$modeContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ContentSecurityPolicyDefaultSourceHook.

Definition at line 1219 of file HookRunner.php.

◆ onContentSecurityPolicyDirectives()

MediaWiki\HookContainer\HookRunner::onContentSecurityPolicyDirectives ( & $directives,
$policyConfig,
$mode )

If ContentSecurityPolicyDefaultSource and ContentSecurityPolicyScriptSource do not meet your needs, use this hook to modify the content security policy directives.

Since
1.35
Parameters
string[]&$directivesArray of CSP directives
array$policyConfigCurrent configuration for the CSP header
int$modeContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ContentSecurityPolicyDirectivesHook.

Definition at line 1228 of file HookRunner.php.

◆ onContentSecurityPolicyScriptSource()

MediaWiki\HookContainer\HookRunner::onContentSecurityPolicyScriptSource ( & $scriptSrc,
$policyConfig,
$mode )

Use this hook to modify the allowed CSP script sources.

Note that you also have to use ContentSecurityPolicyDefaultSource if you want non-script sources to be loaded from whatever you add.

Since
1.35
Parameters
string[]&$scriptSrcArray of CSP directives
array$policyConfigCurrent configuration for the CSP header
int$modeContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ContentSecurityPolicyScriptSourceHook.

Definition at line 1237 of file HookRunner.php.

◆ onContribsPager__getQueryInfo()

MediaWiki\HookContainer\HookRunner::onContribsPager__getQueryInfo ( $pager,
& $queryInfo )

This hook is called before the contributions query is about to run.

Since
1.35
Parameters
ContribsPager$pagerPager object for contributions
array&$queryInfoThe query for the contribs Pager
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ContribsPager__getQueryInfoHook.

Definition at line 1246 of file HookRunner.php.

◆ onContribsPager__reallyDoQuery()

MediaWiki\HookContainer\HookRunner::onContribsPager__reallyDoQuery ( & $data,
$pager,
$offset,
$limit,
$descending )

This hook is called before really executing the query for My Contributions.

Since
1.35
Parameters
array&$dataan array of results of all contribs queries
ContribsPager$pagerThe ContribsPager object hooked into
string$offsetIndex offset, inclusive
int$limitExact query limit
bool$descendingQuery direction, false for ascending, true for descending
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ContribsPager__reallyDoQueryHook.

Definition at line 1253 of file HookRunner.php.

◆ onContributeCards()

MediaWiki\HookContainer\HookRunner::onContributeCards ( & $cards)

Definition at line 1262 of file HookRunner.php.

◆ onContributionsLineEnding()

MediaWiki\HookContainer\HookRunner::onContributionsLineEnding ( $pager,
& $ret,
$row,
& $classes,
& $attribs )

This hook is called before a contributions HTML line is finished.

Since
1.35
Parameters
ContribsPager$pagerThe ContribsPager object hooked into
string&$retThe HTML line
stdClass$rowThe DB row for this line
string[]&$classesThe classes to add to the surrounding
string[]&$attribsAssociative array of other HTML attributes for the element. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ContributionsLineEndingHook.

Definition at line 1269 of file HookRunner.php.

◆ onContributionsToolLinks()

MediaWiki\HookContainer\HookRunner::onContributionsToolLinks ( $id,
Title $title,
array & $tools,
SpecialPage $specialPage )

Use this hook to change the tool links above Special:Contributions.

Since
1.35
Parameters
int$idUser identifier
Title$titleUser page title
string[]&$toolsArray of tool links
SpecialPage$specialPageSpecialPage instance for context and services. Can be either SpecialContributions or DeletedContributionsPage. Extensions should type hint against a generic SpecialPage though.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ContributionsToolLinksHook.

Definition at line 1278 of file HookRunner.php.

◆ onConvertContent()

MediaWiki\HookContainer\HookRunner::onConvertContent ( $content,
$toModel,
$lossy,
& $result )

This hook is called by AbstractContent::convert when a conversion to another content model is requested.

Handler functions that modify $result should generally return false to disable further attempts at conversion.

Since
1.35
Parameters
Content$contentContent object to be converted
string$toModelID of the content model to convert to
bool$lossyWhether lossy conversion is allowed
Content | false&$resultOutput parameter, in case the handler function wants to provide a converted Content object. Note that $result->getContentModel() must return $toModel.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\ConvertContentHook.

Definition at line 1285 of file HookRunner.php.

◆ onCustomEditor()

MediaWiki\HookContainer\HookRunner::onCustomEditor ( $article,
$user )

This hook is called when invoking the page editor.

Since
1.35
Parameters
Article$articleArticle being edited
User$userUser performing the edit
Returns
bool|void True or no return value to allow the normal editor to be used. False if implementing a custom editor, e.g. for a special namespace, etc.

Implements MediaWiki\Hook\CustomEditorHook.

Definition at line 1292 of file HookRunner.php.

◆ onDeletedContribsPager__reallyDoQuery()

MediaWiki\HookContainer\HookRunner::onDeletedContribsPager__reallyDoQuery ( & $data,
$pager,
$offset,
$limit,
$descending )

This hook is called before really executing the query for Special:DeletedContributions.

See also
ContribsPager__reallyDoQueryHook
Since
1.35
Parameters
array&$dataan array of results of all contribs queries
DeletedContribsPager$pagerThe DeletedContribsPager object hooked into
string$offsetIndex offset, inclusive
int$limitExact query limit
bool$descendingQuery direction, false for ascending, true for descending
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\DeletedContribsPager__reallyDoQueryHook.

Definition at line 1299 of file HookRunner.php.

◆ onDeletedContributionsLineEnding()

MediaWiki\HookContainer\HookRunner::onDeletedContributionsLineEnding ( $page,
& $ret,
$row,
& $classes,
& $attribs )

This hook is called before a DeletedContributions HTML line is finished.

See also
ContributionsLineEndingHook
Since
1.35
Parameters
DeletedContribsPager$pagePager object for DeletedContribsPager
string&$retThe HTML line
stdClass$rowThe DB row for this line
string[]&$classesThe classes to add to the surrounding
string[]&$attribsAssociative array of other HTML attributes for the element. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\DeletedContributionsLineEndingHook.

Definition at line 1308 of file HookRunner.php.

◆ onDeleteUnknownPreferences()

MediaWiki\HookContainer\HookRunner::onDeleteUnknownPreferences ( & $where,
$db )

This hook is called by the cleanupPreferences.php maintenance script to build a WHERE clause with which to delete preferences that are not known about.

This hook is used by extensions that have dynamically-named preferences that should not be deleted in the usual cleanup process. For example, the Gadgets extension creates preferences prefixed with 'gadget-', so anything with that prefix is excluded from the deletion.

Since
1.35
Parameters
array&$whereArray that will be passed as the $cond parameter to IReadableDatabase::select() to determine what will be deleted from the user_properties table
IReadableDatabase$dbIReadableDatabase object, useful for accessing $db->expr() to build expressions with IExpression::LIKE and LikeValue
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\DeleteUnknownPreferencesHook.

Definition at line 1317 of file HookRunner.php.

◆ onDifferenceEngineAfterLoadNewText()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineAfterLoadNewText ( $differenceEngine)

This hook is called in DifferenceEngine::loadNewText() after the new revision's content has been loaded into the class member variable $differenceEngine->mNewContent but before returning true from this function.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineAfterLoadNewTextHook.

Definition at line 1324 of file HookRunner.php.

◆ onDifferenceEngineLoadTextAfterNewContentIsLoaded()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineLoadTextAfterNewContentIsLoaded ( $differenceEngine)

This hook is called in DifferenceEngine::loadText() after the new revision's content has been loaded into the class member variable $differenceEngine->mNewContent but before checking if the variable's value is null.

Use this hook to inject content into said class member variable.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineLoadTextAfterNewContentIsLoadedHook.

Definition at line 1342 of file HookRunner.php.

◆ onDifferenceEngineMarkPatrolledLink()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineMarkPatrolledLink ( $differenceEngine,
& $markAsPatrolledLink,
$rcid )

Use this hook to change the "mark as patrolled" link which is shown both on the diff header as well as on the bottom of a page, usually wrapped in a span element which has class="patrollink".

Since
1.35
Parameters
DifferenceEngine$differenceEngine
string&$markAsPatrolledLink"Mark as patrolled" link HTML
int$rcidRecent change ID (rc_id) for this change
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineMarkPatrolledLinkHook.

Definition at line 1351 of file HookRunner.php.

◆ onDifferenceEngineMarkPatrolledRCID()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineMarkPatrolledRCID ( & $rcid,
$differenceEngine,
$change,
$user )

Use this hook to possibly change the rcid parameter.

For example the rcid might be set to zero due to the user being the same as the performer of the change but an extension might still want to show it under certain conditions.

Since
1.35
Parameters
int&$rcidrc_id of the change or 0
DifferenceEngine$differenceEngine
RecentChange | null$change
User$userCurrent user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineMarkPatrolledRCIDHook.

Definition at line 1360 of file HookRunner.php.

◆ onDifferenceEngineNewHeader()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineNewHeader ( $differenceEngine,
& $newHeader,
$formattedRevisionTools,
$nextlink,
$rollback,
$newminor,
$diffOnly,
$rdel,
$unhide )

Use this hook to change the $newHeader variable, which contains information about the new revision, such as the revision's author, whether the revision was marked as a minor edit or not, etc.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
string&$newHeaderString containing the various #mw-diff-otitle[1-5] divs, which include things like revision author info, revision comment, RevisionDelete link and more
array$formattedRevisionToolsArray containing revision tools, some of which may have been injected with the DiffTools hook
string$nextlinkString containing the link to the next revision (if any); also included in $newHeader
string$rollbackRollback link to roll this revision back to the previous one, if any
string$newminorString indicating if the new revision was marked as a minor edit
bool$diffOnlyBoolean parameter passed to DifferenceEngine::showDiffPage, indicating whether we should show just the diff; passed in as a query string parameter to the various URLs constructed here (i.e. $nextlink)
string$rdelRevisionDelete link for the new revision, if the current user is allowed to use the RevisionDelete feature
bool$unhideBoolean parameter indicating whether to show RevisionDeleted revisions
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineNewHeaderHook.

Definition at line 1369 of file HookRunner.php.

◆ onDifferenceEngineOldHeader()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineOldHeader ( $differenceEngine,
& $oldHeader,
$prevlink,
$oldminor,
$diffOnly,
$ldel,
$unhide )

Use this hook to change the $oldHeader variable, which contains information about the old revision, such as the revision's author, whether the revision was marked as a minor edit or not, etc.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
string&$oldHeaderString containing the various #mw-diff-otitle[1-5] divs, which include things like revision author info, revision comment, RevisionDelete link and more
string$prevlinkString containing the link to the previous revision (if any); also included in $oldHeader
string$oldminorString indicating if the old revision was marked as a minor edit
bool$diffOnlyBoolean parameter passed to DifferenceEngine::showDiffPage, indicating whether we should show just the diff; passed in as a query string parameter to the various URLs constructed here (i.e. $prevlink)
string$ldelRevisionDelete link for the old revision, if the current user is allowed to use the RevisionDelete feature
bool$unhideBoolean parameter indicating whether to show RevisionDeleted revisions
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineOldHeaderHook.

Definition at line 1380 of file HookRunner.php.

◆ onDifferenceEngineOldHeaderNoOldRev()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineOldHeaderNoOldRev ( & $oldHeader)

Use this hook to change the $oldHeader variable in cases when there is no old revision.

Since
1.35
Parameters
string&$oldHeaderEmpty string by default
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineOldHeaderNoOldRevHook.

Definition at line 1390 of file HookRunner.php.

◆ onDifferenceEngineRenderRevisionAddParserOutput()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineRenderRevisionAddParserOutput ( $differenceEngine,
$out,
$parserOutput,
$wikiPage )

Use this hook to change the parser output.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
OutputPage$out
ParserOutput$parserOutput
WikiPage$wikiPage
Returns
bool|void True or no return value to continue, or false to not add parser output via OutputPage's addParserOutput method

Implements MediaWiki\Diff\Hook\DifferenceEngineRenderRevisionAddParserOutputHook.

Definition at line 1397 of file HookRunner.php.

◆ onDifferenceEngineRenderRevisionShowFinalPatrolLink()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineRenderRevisionShowFinalPatrolLink ( )

Use this hook to not show the final "mark as patrolled" link on the bottom of a page.

This hook has no arguments.

Since
1.35
Returns
bool|void True or no return value to continue, or false to not show the final "mark as patrolled" link

Implements MediaWiki\Diff\Hook\DifferenceEngineRenderRevisionShowFinalPatrolLinkHook.

Definition at line 1406 of file HookRunner.php.

◆ onDifferenceEngineShowDiff()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineShowDiff ( $differenceEngine)

Use this hook to affect the diff text which eventually gets sent to the OutputPage object.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineShowDiffHook.

Definition at line 1413 of file HookRunner.php.

◆ onDifferenceEngineShowDiffPage()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineShowDiffPage ( $out)

Use this hook to add additional output via the available OutputPage object into the diff view.

Since
1.35
Parameters
OutputPage$out
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineShowDiffPageHook.

Definition at line 1420 of file HookRunner.php.

◆ onDifferenceEngineShowDiffPageMaybeShowMissingRevision()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineShowDiffPageMaybeShowMissingRevision ( $differenceEngine)

This hook is called in DifferenceEngine::showDiffPage() when revision data cannot be loaded.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
Returns
bool|void True or no return value to continue, or false to prevent displaying the missing revision message (i.e. to prevent DifferenceEngine::showMissingRevision() from being called)

Implements MediaWiki\Diff\Hook\DifferenceEngineShowDiffPageMaybeShowMissingRevisionHook.

Definition at line 1427 of file HookRunner.php.

◆ onDifferenceEngineShowEmptyOldContent()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineShowEmptyOldContent ( $differenceEngine)

Use this hook to change the diff table body (without header) in cases when there is no old revision or the old and new revisions are identical.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineShowEmptyOldContentHook.

Definition at line 1436 of file HookRunner.php.

◆ onDifferenceEngineViewHeader()

MediaWiki\HookContainer\HookRunner::onDifferenceEngineViewHeader ( $differenceEngine)

This hook is called before diff display.

Since
1.35
Parameters
DifferenceEngine$differenceEngine
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DifferenceEngineViewHeaderHook.

Definition at line 1443 of file HookRunner.php.

◆ onDiffTools()

MediaWiki\HookContainer\HookRunner::onDiffTools ( $newRevRecord,
& $links,
$oldRevRecord,
$userIdentity )

Use this hook to override or extend the revision tools available from the diff view, i.e.

undo, etc.

Since
1.35
Parameters
RevisionRecord$newRevRecordNew revision
string[]&$linksArray of HTML links
RevisionRecord | null$oldRevRecordOld revision (may be null)
UserIdentity$userIdentityCurrent user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\DiffToolsHook.

Definition at line 1450 of file HookRunner.php.

◆ onDisplayOldSubtitle()

MediaWiki\HookContainer\HookRunner::onDisplayOldSubtitle ( $article,
& $oldid )

This hook is called before creating subtitle when browsing old versions of an article.

Since
1.35
Parameters
Article$articleArticle being viewed
int&$oldidOld ID being viewed
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\DisplayOldSubtitleHook.

Definition at line 1457 of file HookRunner.php.

◆ onEditFilter()

MediaWiki\HookContainer\HookRunner::onEditFilter ( $editor,
$text,
$section,
& $error,
$summary )

Use this hook to perform checks on an edit.

Since
1.35
Parameters
EditPage$editorEdit form (see includes/EditPage.php)
string$textContents of the edit box
string$sectionSection being edited
string&$errorError message to return
string$summaryEdit summary for page
Returns
bool|void True or no return value without altering $error to allow the edit to continue. Modifying $error and returning true will cause the contents of $error to be echoed at the top of the edit form as wikitext. Return false to halt editing; you'll need to handle error messages, etc. yourself.

Implements MediaWiki\Hook\EditFilterHook.

Definition at line 1464 of file HookRunner.php.

◆ onEditFilterMergedContent()

MediaWiki\HookContainer\HookRunner::onEditFilterMergedContent ( $context,
$content,
$status,
$summary,
$user,
$minoredit )

Definition at line 1471 of file HookRunner.php.

◆ onEditFormInitialText()

MediaWiki\HookContainer\HookRunner::onEditFormInitialText ( $editPage)

Use this hook to modify the edit form when editing existing pages.

Since
1.35
Parameters
EditPage$editPage
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditFormInitialTextHook.

Definition at line 1480 of file HookRunner.php.

◆ onEditFormPreloadText()

MediaWiki\HookContainer\HookRunner::onEditFormPreloadText ( & $text,
$title )

Use this hook to populate the edit form when creating pages.

Since
1.35
Parameters
string&$textText to preload with
Title$titlePage being created
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditFormPreloadTextHook.

Definition at line 1487 of file HookRunner.php.

◆ onEditPage__attemptSave()

MediaWiki\HookContainer\HookRunner::onEditPage__attemptSave ( $editpage_Obj)

This hook is called before an article is saved, before WikiPage::doUserEditContent() is called.

Since
1.35
Parameters
EditPage$editpage_ObjCurrent EditPage object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPage__attemptSaveHook.

Definition at line 1557 of file HookRunner.php.

◆ onEditPage__attemptSave_after()

MediaWiki\HookContainer\HookRunner::onEditPage__attemptSave_after ( $editpage_Obj,
$status,
$resultDetails )

This hook is called after an article save attempt.

Since
1.35
Parameters
EditPage$editpage_ObjCurrent EditPage object
Status$statusResulting Status object
array$resultDetailsResult details array
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPage__attemptSave_afterHook.

Definition at line 1564 of file HookRunner.php.

◆ onEditPage__importFormData()

MediaWiki\HookContainer\HookRunner::onEditPage__importFormData ( $editpage,
$request )

Use this hook to read additional data posted in the form.

Since
1.35
Parameters
EditPage$editpage
WebRequest$request
Returns
bool|void Return value is ignored; this hook should always return true

Implements MediaWiki\Hook\EditPage__importFormDataHook.

Definition at line 1573 of file HookRunner.php.

◆ onEditPage__showEditForm_fields()

MediaWiki\HookContainer\HookRunner::onEditPage__showEditForm_fields ( $editor,
$out )

Use this hook to inject form field into edit form.

Since
1.35
Parameters
EditPage$editorEditPage instance for reference
OutputPage$outOutputPage instance to write to
Returns
bool|void Return value is ignored; this hook should always return true

Implements MediaWiki\Hook\EditPage__showEditForm_fieldsHook.

Definition at line 1580 of file HookRunner.php.

◆ onEditPage__showEditForm_initial()

MediaWiki\HookContainer\HookRunner::onEditPage__showEditForm_initial ( $editor,
$out )

This hook is called before showing the edit form.

Since
1.35
Parameters
EditPage$editor
OutputPage$outOutputPage instance to write to
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPage__showEditForm_initialHook.

Definition at line 1587 of file HookRunner.php.

◆ onEditPage__showReadOnlyForm_initial()

MediaWiki\HookContainer\HookRunner::onEditPage__showReadOnlyForm_initial ( $editor,
$out )

This hook is similar to EditPage::showEditForm:initial but for the read-only 'view source' variant of the edit form.

Since
1.35
Parameters
EditPage$editor
OutputPage$outOutputPage instance to write to
Returns
bool|void Return value is ignored; this hook should always return true

Implements MediaWiki\Hook\EditPage__showReadOnlyForm_initialHook.

Definition at line 1594 of file HookRunner.php.

◆ onEditPage__showStandardInputs_options()

MediaWiki\HookContainer\HookRunner::onEditPage__showStandardInputs_options ( $editor,
$out,
& $tabindex )

Use this hook to inject form fields into the editOptions area.

Since
1.35
Parameters
EditPage$editor
OutputPage$outOutputPage instance to write to
int&$tabindexHTML tabindex of the last edit check/button
Returns
bool|void Return value is ignored; this hook should always return true

Implements MediaWiki\Hook\EditPage__showStandardInputs_optionsHook.

Definition at line 1601 of file HookRunner.php.

◆ onEditPageBeforeConflictDiff()

MediaWiki\HookContainer\HookRunner::onEditPageBeforeConflictDiff ( $editor,
$out )

Use this hook to modify the EditPage object and output when there's an edit conflict.

Since
1.35
Parameters
EditPage$editor
OutputPage$out
Returns
bool|void True or no return value to continue. False to halt normal diff output; in this case you're responsible for computing and outputting the entire "conflict" part, i.e., the "difference between revisions" and "your text" headers and sections.

Implements MediaWiki\Hook\EditPageBeforeConflictDiffHook.

Definition at line 1494 of file HookRunner.php.

◆ onEditPageBeforeEditButtons()

MediaWiki\HookContainer\HookRunner::onEditPageBeforeEditButtons ( $editpage,
& $buttons,
& $tabindex )

Use this hook to modify the edit buttons below the textarea in the edit form.

Since
1.35
Parameters
EditPage$editpageCurrent EditPage object
array&$buttonsArray of edit buttons, "Save", "Preview", "Live", and "Diff"
int&$tabindexHTML tabindex of the last edit check/button
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPageBeforeEditButtonsHook.

Definition at line 1501 of file HookRunner.php.

◆ onEditPageBeforeEditToolbar()

MediaWiki\HookContainer\HookRunner::onEditPageBeforeEditToolbar ( & $toolbar)

Use this hook to add an edit toolbar above the textarea in the edit form.

Since
1.35
Parameters
string&$toolbarToolbar HTML, initially an empty <div id="toolbar"></div>
Returns
bool|void True or no return value to continue, or false to have no toolbar HTML be loaded

Implements MediaWiki\Hook\EditPageBeforeEditToolbarHook.

Definition at line 1508 of file HookRunner.php.

◆ onEditPageCopyrightWarning()

MediaWiki\HookContainer\HookRunner::onEditPageCopyrightWarning ( $title,
& $msg )

Use this hook for site and per-namespace customization of contribution/copyright notice.

Since
1.35
Parameters
Title$titleTitle of page being edited
array&$msgAn array of arguments to wfMessage(), overridable. The default is an array containing either 'copyrightwarning' or 'copyrightwarning2' as the first element (the message key).
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPageCopyrightWarningHook.

Definition at line 1515 of file HookRunner.php.

◆ onEditPageGetCheckboxesDefinition()

MediaWiki\HookContainer\HookRunner::onEditPageGetCheckboxesDefinition ( $editpage,
& $checkboxes )

Use this hook to modify the edit checkboxes and other form fields below the textarea in the edit form.

Since
1.35
Parameters
EditPage$editpageCurrent EditPage object
array&$checkboxesArray of checkbox definitions. See EditPage::getCheckboxesDefinition() for the format.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPageGetCheckboxesDefinitionHook.

Definition at line 1522 of file HookRunner.php.

◆ onEditPageGetDiffContent()

MediaWiki\HookContainer\HookRunner::onEditPageGetDiffContent ( $editPage,
& $newtext )

Use this hook to modify the wikitext that will be used in "Show changes".

Note that it is preferable to implement diff handling for different data types using the ContentHandler facility.

Since
1.35
Parameters
EditPage$editPage
Content&$newtextContent that will be used in place of "Show changes"
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPageGetDiffContentHook.

Definition at line 1529 of file HookRunner.php.

◆ onEditPageGetPreviewContent()

MediaWiki\HookContainer\HookRunner::onEditPageGetPreviewContent ( $editPage,
& $content )

Use this hook to modify the wikitext that will be previewed.

Note that it is preferable to implement previews for different data types using the ContentHandler facility.

Since
1.35
Parameters
EditPage$editPage
Content&$contentContent object to be previewed (may be replaced by hook function)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPageGetPreviewContentHook.

Definition at line 1536 of file HookRunner.php.

◆ onEditPageNoSuchSection()

MediaWiki\HookContainer\HookRunner::onEditPageNoSuchSection ( $editpage,
& $res )

This hook is called when a section edit request is given for a non-existent section.

Since
1.35
Parameters
EditPage$editpageCurrent EditPage object
string&$resHTML of the error text
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPageNoSuchSectionHook.

Definition at line 1543 of file HookRunner.php.

◆ onEditPageTosSummary()

MediaWiki\HookContainer\HookRunner::onEditPageTosSummary ( $title,
& $msg )

Use this hook for site and per-namespace customizations of terms of service summary link that might exist separately from the copyright notice.

Since
1.35
Parameters
Title$titleTitle of page being edited
string&$msgLocalization message name, overridable. Defaults to 'editpage-tos-summary'
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EditPageTosSummaryHook.

Definition at line 1550 of file HookRunner.php.

◆ onEmailConfirmed()

MediaWiki\HookContainer\HookRunner::onEmailConfirmed ( $user,
& $confirmed )

This hook is called when checking that the user's email address is "confirmed".

This runs before the other checks, such as anonymity and the real check; return true to allow those checks to occur, and false if checking is done.

Since
1.35
Parameters
User$userUser being checked
bool&$confirmedWhether or not the email address is confirmed
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\EmailConfirmedHook.

Definition at line 1610 of file HookRunner.php.

◆ onEmailUser()

MediaWiki\HookContainer\HookRunner::onEmailUser ( & $to,
& $from,
& $subject,
& $text,
& $error )

This hook is called before sending email from one user to another.

Since
1.35
Parameters
MailAddress&$toMailAddress object of receiving user
MailAddress&$fromMailAddress object of sending user
string&$subjectsubject of the mail
string&$texttext of the mail
bool | Status | MessageSpecifier | array&$errorOut-param for an error. Should be set to a Status object or boolean false.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EmailUserHook.

Definition at line 1617 of file HookRunner.php.

◆ onEmailUserAuthorizeSend()

MediaWiki\HookContainer\HookRunner::onEmailUserAuthorizeSend ( Authority $sender,
StatusValue $status )

This hook is called when checking whether a user is allowed to send emails.

Parameters
Authority$sender
StatusValue$statusAdd any error here
Returns
bool|void True or no return value to continue, false to abort, which also requires adding a fatal error to $status.

Implements MediaWiki\Mail\Hook\EmailUserAuthorizeSendHook.

Definition at line 1652 of file HookRunner.php.

◆ onEmailUserCC()

MediaWiki\HookContainer\HookRunner::onEmailUserCC ( & $to,
& $from,
& $subject,
& $text )

This hook is called before sending the copy of the email to the author.

Since
1.35
Parameters
MailAddress&$toMailAddress object of receiving user
MailAddress&$fromMailAddress object of sending user
string&$subjectSubject of the mail
string&$textText of the mail
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EmailUserCCHook.

Definition at line 1624 of file HookRunner.php.

◆ onEmailUserComplete()

MediaWiki\HookContainer\HookRunner::onEmailUserComplete ( $to,
$from,
$subject,
$text )

This hook is called after sending email from one user to another.

Since
1.35
Parameters
MailAddress$toMailAddress object of receiving user
MailAddress$fromMailAddress object of sending user
string$subjectsubject of the mail
string$texttext of the mail
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EmailUserCompleteHook.

Definition at line 1631 of file HookRunner.php.

◆ onEmailUserForm()

MediaWiki\HookContainer\HookRunner::onEmailUserForm ( & $form)

This hook is called after building the email user form object.

Since
1.35
Parameters
HTMLForm&$formHTMLForm object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EmailUserFormHook.

Definition at line 1638 of file HookRunner.php.

◆ onEmailUserPermissionsErrors()

MediaWiki\HookContainer\HookRunner::onEmailUserPermissionsErrors ( $user,
$editToken,
& $hookErr )

Use this hook to retrieve permissions errors for emailing a user.

Since
1.35
Parameters
User$userThe user who is trying to email another user.
string$editTokenThe user's edit token.
bool | string | array&$hookErrOut-param for the error. Passed as the parameters to OutputPage::showErrorPage.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EmailUserPermissionsErrorsHook.

Definition at line 1645 of file HookRunner.php.

◆ onEmailUserSendEmail()

MediaWiki\HookContainer\HookRunner::onEmailUserSendEmail ( Authority $from,
MailAddress $fromAddress,
UserEmailContact $to,
MailAddress $toAddress,
string $subject,
string $text,
StatusValue $status )

This hook is called before sending an email, when all other checks have succeeded.

Parameters
Authority$from
MailAddress$fromAddressMailAddress of the sender
UserEmailContact$to
MailAddress$toAddressMailAddress of the target
string$subject
string$text
StatusValue$statusAdd any error here
Returns
bool|void True or no return value to continue. To abort, return false and add a fatal error to $status.

Implements MediaWiki\Mail\Hook\EmailUserSendEmailHook.

Definition at line 1659 of file HookRunner.php.

◆ onEnhancedChangesList__getLogText()

MediaWiki\HookContainer\HookRunner::onEnhancedChangesList__getLogText ( $changesList,
& $links,
$block )

Use this hook to alter, remove, or add to the links of a group of changes in EnhancedChangesList.

Since
1.35
Parameters
EnhancedChangesList$changesList
string[]&$linksLinks generated by EnhancedChangesList
RecentChange[]$blockRecentChange objects in that block
Returns
bool|void True or no return value to continue, or false to omit this line from recentchanges

Implements MediaWiki\Hook\EnhancedChangesList__getLogTextHook.

Definition at line 1692 of file HookRunner.php.

◆ onEnhancedChangesListModifyBlockLineData()

MediaWiki\HookContainer\HookRunner::onEnhancedChangesListModifyBlockLineData ( $changesList,
& $data,
$rc )

Use this hook to alter data used to build a non-grouped recent change line in EnhancedChangesList.

Since
1.35
Parameters
EnhancedChangesList$changesList
array&$dataArray of components that will be joined in order to create the line
RecentChange$rcRecentChange object for this line
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\EnhancedChangesListModifyBlockLineDataHook.

Definition at line 1674 of file HookRunner.php.

◆ onEnhancedChangesListModifyLineData()

MediaWiki\HookContainer\HookRunner::onEnhancedChangesListModifyLineData ( $changesList,
& $data,
$block,
$rc,
& $classes,
& $attribs )

Use this hook to alter data used to build a grouped recent change inner line in EnhancedChangesList.

Since
1.35
Parameters
EnhancedChangesList$changesList
array&$dataArray of components that will be joined in order to create the line
RecentChange[]$blockArray of RecentChange objects in that block
RecentChange$rcRecentChange object for this line
string[]&$classesArray of classes to change
string[]&$attribsAssociative array of other HTML attributes for the <tr> element. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).
Returns
bool|void True or no return value to continue, or false to omit this line from recentchanges

Implements MediaWiki\Hook\EnhancedChangesListModifyLineDataHook.

Definition at line 1683 of file HookRunner.php.

◆ onExemptFromAccountCreationThrottle()

MediaWiki\HookContainer\HookRunner::onExemptFromAccountCreationThrottle ( $ip)

Use this hook to add an exemption from the account creation throttle.

Since
1.35
Parameters
string$ipIP address of the user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Auth\Hook\ExemptFromAccountCreationThrottleHook.

Definition at line 1701 of file HookRunner.php.

◆ onExtensionTypes()

MediaWiki\HookContainer\HookRunner::onExtensionTypes ( & $extTypes)

This hook is called when generating the extensions credits.

Use this to change the tables headers.

Since
1.35
Parameters
string[]&$extTypesAssociative array of extensions types. The key of each element contains the symbolic type string as used in extension.json, and the value contains the description of the type, in the current user language, to be used as a header on Special:Version.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ExtensionTypesHook.

Definition at line 1708 of file HookRunner.php.

◆ onFetchChangesList()

MediaWiki\HookContainer\HookRunner::onFetchChangesList ( $user,
$skin,
& $list,
$groups )

This hook is called when fetching the ChangesList derivative for a particular user.

Since
1.35
Parameters
User$userUser the list is being fetched for
Skin$skinSkin object to be used with the list
ChangesList | null&$listDefaults to NULL. Change it to an object instance and return false to override the list derivative used.
ChangesListFilterGroup[]$groupsAdded in 1.34
Returns
bool|void True or no return value to continue, or false to override the list derivative used

Implements MediaWiki\Hook\FetchChangesListHook.

Definition at line 1715 of file HookRunner.php.

◆ onFileDeleteComplete()

MediaWiki\HookContainer\HookRunner::onFileDeleteComplete ( $file,
$oldimage,
$article,
$user,
$reason )

This hook is called when a file is deleted.

Since
1.35
Parameters
LocalFile$fileReference to the deleted file
string | null$oldimageIn case of the deletion of an old image, the name of the old file
WikiFilePage | null$articleIn case all revisions of the file are deleted, a reference to the WikiFilePage associated with the file
User$userUser who performed the deletion
string$reason
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\FileDeleteCompleteHook.

Definition at line 1722 of file HookRunner.php.

◆ onFileTransformed()

MediaWiki\HookContainer\HookRunner::onFileTransformed ( $file,
$thumb,
$tmpThumbPath,
$thumbPath )

This hook is called when a file is transformed and moved into storage.

Since
1.35
Parameters
File$fileReference to the File object
MediaTransformOutput$thumb
string$tmpThumbPathTemporary file system path of the transformed file
string$thumbPathPermanent storage path of the transformed file
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\FileTransformedHook.

Definition at line 1731 of file HookRunner.php.

◆ onFileUndeleteComplete()

MediaWiki\HookContainer\HookRunner::onFileUndeleteComplete ( $title,
$fileVersions,
$user,
$reason )

This hook is called when a file is undeleted.

Since
1.35
Parameters
Title$titleTitle object for the file
int[]$fileVersionsArray of undeleted filearchive IDs. Empty if all versions were restored.
User$userUser who performed the undeletion
string$reason
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\FileUndeleteCompleteHook.

Definition at line 1738 of file HookRunner.php.

◆ onFileUpload()

MediaWiki\HookContainer\HookRunner::onFileUpload ( $file,
$reupload,
$hasDescription )

This hook is called when a file upload occurs.

Since
1.35
Parameters
File$fileImage object representing the file that was uploaded
bool$reuploadBoolean indicating if there was a previously another image there or not (since 1.17)
bool$hasDescriptionBoolean indicating that there was already a description page and a new one from the comment wasn't created (since 1.17)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\FileUploadHook.

Definition at line 1745 of file HookRunner.php.

◆ onFormatAutocomments()

MediaWiki\HookContainer\HookRunner::onFormatAutocomments ( & $comment,
$pre,
$auto,
$post,
$title,
$local,
$wikiId )

This hook is called when an autocomment is formatted by the Linker.

Since
1.35
Parameters
string | null&$commentReference to the accumulated comment. Initially null, when set the default code will be skipped.
bool$preTrue if there is text before this autocomment
string$autoExtracted part of the parsed comment before the call to the hook
bool$postTrue if there is text after this autocomment
Title | null$titleOptional title object used to links to sections
bool$localWhether section links should refer to local page
string | null$wikiIdID (as used by WikiMap) of the wiki from which the autocomment originated; null for the local wiki. Added in 1.26, should default to null in handler functions, for backwards compatibility.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\FormatAutocommentsHook.

Definition at line 1752 of file HookRunner.php.

◆ onGalleryGetModes()

MediaWiki\HookContainer\HookRunner::onGalleryGetModes ( & $modeArray)

Use this hook to get a list of classes that can render different modes of a gallery.

Since
1.35
Parameters
array&$modeArrayAssociative array mapping mode names to classes that implement that mode. It is expected that all registered classes are a subclass of ImageGalleryBase.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GalleryGetModesHook.

Definition at line 1761 of file HookRunner.php.

◆ onGetActionName()

MediaWiki\HookContainer\HookRunner::onGetActionName ( IContextSource $context,
string & $action )

Use this hook to override the action name depending on request parameters.

Since
1.37
Parameters
IContextSource$contextRequest context
string&$actionDefault action name, reassign to change it
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Actions\Hook\GetActionNameHook.

Definition at line 1783 of file HookRunner.php.

◆ onGetAllBlockActions()

MediaWiki\HookContainer\HookRunner::onGetAllBlockActions ( & $actions)

Use this hook to add an action or actions that may be blocked by a partial block.

Add an item to the $actions array with:

  • key: unique action string (as it appears in the code)
  • value: unique integer ID

The ID must be 100 or greater (IDs below 100 are reserved for core actions), must not conflict with other extension IDs, and must be documented at: https://www.mediawiki.org/wiki/Manual:Hooks/GetAllBlockActions

Since
1.37
Parameters
int[]&$actionsArray of actions, which may be added to
Returns
bool|void True or no return value to continue; callers of this hook should not abort it

Implements MediaWiki\Block\Hook\GetAllBlockActionsHook.

Definition at line 1768 of file HookRunner.php.

◆ onGetAutoPromoteGroups()

MediaWiki\HookContainer\HookRunner::onGetAutoPromoteGroups ( $user,
& $promote )

This hook is called when determining which autopromote groups a user is entitled to be in.

Since
1.35
Parameters
User$userUser to promote
string[]&$promoteGroups that will be added
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\GetAutoPromoteGroupsHook.

Definition at line 1776 of file HookRunner.php.

◆ onGetBlockErrorMessageKey()

MediaWiki\HookContainer\HookRunner::onGetBlockErrorMessageKey ( $block,
& $key )

Definition at line 2594 of file HookRunner.php.

◆ onGetCacheVaryCookies()

MediaWiki\HookContainer\HookRunner::onGetCacheVaryCookies ( $out,
& $cookies )

Use this hook to get cookies that should vary cache options.

Since
1.35
Parameters
OutputPage$out
string[]&$cookiesArray of cookie names. Add a value to it if you want to add a cookie that has to vary cache options.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Output\Hook\GetCacheVaryCookiesHook.

Definition at line 1791 of file HookRunner.php.

◆ onGetCanonicalURL()

MediaWiki\HookContainer\HookRunner::onGetCanonicalURL ( $title,
& $url,
$query )

Use this hook to modify fully-qualified URLs used for IRC and email notifications.

Since
1.35
Parameters
Title$titleTitle object of page
string&$urlString value as output (out parameter, can modify)
string$queryQuery options as string passed to Title::getCanonicalURL()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetCanonicalURLHook.

Definition at line 1798 of file HookRunner.php.

◆ onGetContentModels()

MediaWiki\HookContainer\HookRunner::onGetContentModels ( & $models)

Use this hook to add content models to the list of available models.

Since
1.35
Parameters
string[]&$modelsArray containing current model list as strings. Extensions should add to this list.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\GetContentModelsHook.

Definition at line 1805 of file HookRunner.php.

◆ onGetDefaultSortkey()

MediaWiki\HookContainer\HookRunner::onGetDefaultSortkey ( $title,
& $sortkey )

Use this hook to override the default sortkey for a page.

Since
1.35
Parameters
Title$titleTitle object that we need to get a sortkey for
string&$sortkeySortkey to use
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetDefaultSortkeyHook.

Definition at line 1812 of file HookRunner.php.

◆ onGetDifferenceEngine()

MediaWiki\HookContainer\HookRunner::onGetDifferenceEngine ( $context,
$old,
$new,
$refreshCache,
$unhide,
& $differenceEngine )

This hook is called when getting a new difference engine interface object.

Use this hook to decorate or replace the default difference engine.

Since
1.35
Parameters
IContextSource$contextIContextSource context to be used for diff
int$oldRevision ID to show and diff with
int | string$newEither a revision ID or one of the strings 'cur', 'prev' or 'next'
bool$refreshCacheIf set, refreshes the diff cache
bool$unhideIf set, allow viewing deleted revs
DifferenceEngine&$differenceEngineDifference engine object to be used for the diff
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\GetDifferenceEngineHook.

Definition at line 1819 of file HookRunner.php.

◆ onGetDoubleUnderscoreIDs()

MediaWiki\HookContainer\HookRunner::onGetDoubleUnderscoreIDs ( & $doubleUnderscoreIDs)

Use this hook to modify the list of behavior switches (double underscore variables in wikitext).

Behavior switches are localized with the magic word system, and this hook is called by MagicWordFactory.

Since
1.35
Parameters
string[]&$doubleUnderscoreIDsArray of magic word identifiers
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetDoubleUnderscoreIDsHook.

Definition at line 1829 of file HookRunner.php.

◆ onGetExtendedMetadata()

MediaWiki\HookContainer\HookRunner::onGetExtendedMetadata ( & $combinedMeta,
$file,
$context,
$single,
& $maxCacheTime )

Use this hook to get extended file metadata for the API.

Since
1.35
Parameters
array&$combinedMetaArray of the form: 'MetadataPropName' => [ value' => prop value, 'source' => 'name of hook' ]
File$fileFile in question
IContextSource$contextRequestContext (including language to use)
bool$singleOnly extract the current language; if false, the prop value should be in the metadata multi-language array format: https://mediawiki.org/wiki/Manual:File_metadata_handling#Multi-language_array_format
int&$maxCacheTimeHow long the results can be cached
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetExtendedMetadataHook.

Definition at line 1836 of file HookRunner.php.

◆ onGetFullURL()

MediaWiki\HookContainer\HookRunner::onGetFullURL ( $title,
& $url,
$query )

Use this hook to modify fully-qualified URLs used in redirects/export/offsite data.

Since
1.35
Parameters
Title$titleTitle object of page
string&$urlString value as output (out parameter, can modify)
string$queryQuery options as string passed to Title::getFullURL()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetFullURLHook.

Definition at line 1845 of file HookRunner.php.

◆ onGetHumanTimestamp()

MediaWiki\HookContainer\HookRunner::onGetHumanTimestamp ( & $output,
$timestamp,
$relativeTo,
$user,
$lang )

Use this hook to preemptively override the human-readable timestamp generated by Language::getHumanTimestamp().

Since
1.35
Parameters
string&$outputOutput timestamp
MWTimestamp$timestampCurrent (user-adjusted) timestamp
MWTimestamp$relativeToRelative (user-adjusted) timestamp
User$userUser whose preferences are being used to make timestamp
Language$langLanguage that will be used to render the timestamp
Returns
bool|void True or no return value to continue, or false to use the custom output

Implements MediaWiki\Hook\GetHumanTimestampHook.

Definition at line 1852 of file HookRunner.php.

◆ onGetInternalURL()

MediaWiki\HookContainer\HookRunner::onGetInternalURL ( $title,
& $url,
$query )

Use this hook to modify fully-qualified URLs used for squid cache purging.

Since
1.35
Parameters
Title$titleTitle object of page
string&$urlString value as output (out parameter, can modify)
string$queryQuery options as string passed to Title::getInternalURL()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetInternalURLHook.

Definition at line 1861 of file HookRunner.php.

◆ onGetIP()

MediaWiki\HookContainer\HookRunner::onGetIP ( & $ip)

Use this hook to modify the IP of the current user (called only once).

Since
1.35
Parameters
string&$ipIP as determined so far
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetIPHook.

Definition at line 1868 of file HookRunner.php.

◆ onGetLangPreferredVariant()

MediaWiki\HookContainer\HookRunner::onGetLangPreferredVariant ( & $req)

This hook is called in LanguageConverter::getPreferredVariant() to allow fetching the language variant code from cookies or other such alternative storage.

Since
1.35
Parameters
string | null&$reqLanguage variant from the URL or null if no variant was specified in the URL; the value of this variable comes from LanguageConverter::getURLVariant()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetLangPreferredVariantHook.

Definition at line 1875 of file HookRunner.php.

◆ onGetLinkColours()

MediaWiki\HookContainer\HookRunner::onGetLinkColours ( $linkcolour_ids,
& $colours,
$title )

Use this hook to modify the CSS class of an array of page links.

Since
1.35
Parameters
string[]$linkcolour_idsArray of prefixed DB keys of the pages linked to, indexed by page_id
string[]&$colours(Output) Array of CSS classes, indexed by prefixed DB keys
Title$titleTitle of the page being parsed, on which the links will be shown
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetLinkColoursHook.

Definition at line 1882 of file HookRunner.php.

◆ onGetLocalURL()

MediaWiki\HookContainer\HookRunner::onGetLocalURL ( $title,
& $url,
$query )

Use this hook to modify local URLs as output into page links.

Note that if you are working with internal urls (non-interwiki) then it may be preferable to work with the GetLocalURL::Internal or GetLocalURL::Article hooks as GetLocalURL can be buggy for internal URLs on render if you do not re-implement the horrible hack that Title::getLocalURL uses in your own extension.

Since
1.35
Parameters
Title$titleTitle object of page
string&$urlString value as output (out parameter, can modify)
string$queryQuery options as string passed to Title::getLocalURL()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetLocalURLHook.

Definition at line 1889 of file HookRunner.php.

◆ onGetLocalURL__Article()

MediaWiki\HookContainer\HookRunner::onGetLocalURL__Article ( $title,
& $url )

Use this hook to modify local URLs specifically pointing to article paths without any fancy queries or variants.

Since
1.35
Parameters
Title$titleTitle object of page
string&$urlString value as output (out parameter, can modify)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetLocalURL__ArticleHook.

Definition at line 1896 of file HookRunner.php.

◆ onGetLocalURL__Internal()

MediaWiki\HookContainer\HookRunner::onGetLocalURL__Internal ( $title,
& $url,
$query )

Use this hook to modify local URLs to internal pages.

Since
1.35
Parameters
Title$titleTitle object of page
string&$urlString value as output (out parameter, can modify)
string$queryQuery options as string passed to Title::getLocalURL()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetLocalURL__InternalHook.

Definition at line 1903 of file HookRunner.php.

◆ onGetLogTypesOnUser()

MediaWiki\HookContainer\HookRunner::onGetLogTypesOnUser ( & $types)

Use this hook to add log types where the target is a user page.

Since
1.35
Parameters
string[]&$typesArray of log types
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetLogTypesOnUserHook.

Definition at line 1910 of file HookRunner.php.

◆ onGetMagicVariableIDs()

MediaWiki\HookContainer\HookRunner::onGetMagicVariableIDs ( & $variableIDs)

Use this hook to modify the list of magic variables.

Magic variables are localized with the magic word system, and this hook is called by MagicWordFactory.

Since
1.35
Parameters
string[]&$variableIDsarray of magic word identifiers
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetMagicVariableIDsHook.

Definition at line 1917 of file HookRunner.php.

◆ onGetMetadataVersion()

MediaWiki\HookContainer\HookRunner::onGetMetadataVersion ( & $version)

Use this hook to modify the image metadata version currently in use.

This is used when requesting image metadata from a ForeignApiRepo. Media handlers that need to have versioned metadata should add an element to the end of the version array of the form 'handler_name=version'. Most media handlers won't need to do this unless they broke backwards compatibility with a previous version of the media handler metadata output.

Since
1.35
Parameters
string[]&$versionArray of version strings
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetMetadataVersionHook.

Definition at line 1924 of file HookRunner.php.

◆ onGetNewMessagesAlert()

MediaWiki\HookContainer\HookRunner::onGetNewMessagesAlert ( & $newMessagesAlert,
$newtalks,
$user,
$out )

Use this hook to disable or modify the new messages alert.

Since
1.35
Parameters
string&$newMessagesAlertEmpty string by default. If the user has new talk page messages, this should be populated with an alert message to that effect.
array$newtalksEmpty array if the user has no new messages, or an array containing links and revisions if there are new messages. (See Skin::getNewtalks().)
User$userUser who is loading the page
OutputPage$outTo check what type of page the user is on
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GetNewMessagesAlertHook.

Definition at line 1931 of file HookRunner.php.

◆ onGetPreferences()

MediaWiki\HookContainer\HookRunner::onGetPreferences ( $user,
& $preferences )

Use this hook to modify user preferences.

Since
1.35
Parameters
User$userUser whose preferences are being modified
array&$preferencesPreferences description array, to be fed to an HTMLForm object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Preferences\Hook\GetPreferencesHook.

Definition at line 1940 of file HookRunner.php.

◆ onGetRelativeTimestamp()

MediaWiki\HookContainer\HookRunner::onGetRelativeTimestamp ( & $output,
& $diff,
$timestamp,
$relativeTo,
$user,
$lang )

Use this hook to pre-emptively override the relative timestamp generated by MWTimestamp::getRelativeTimestamp().

Since
1.35
Parameters
string&$outputString for the output timestamp
DateInterval&$diffDifference between the timestamps
MWTimestamp$timestampCurrent (user-adjusted) timestamp
MWTimestamp$relativeToRelative (user-adjusted) timestamp
User$userUser whose preferences are being used to make timestamp
Language$langLanguage that will be used to render the timestamp
Returns
bool|void True or no return value to continue, or false to use the custom output

Implements MediaWiki\Hook\GetRelativeTimestampHook.

Definition at line 1947 of file HookRunner.php.

◆ onGetSlotDiffRenderer()

MediaWiki\HookContainer\HookRunner::onGetSlotDiffRenderer ( $contentHandler,
& $slotDiffRenderer,
$context )

Use this hook to replace or wrap the standard SlotDiffRenderer for some content type.

Since
1.35
Parameters
ContentHandler$contentHandlerContentHandler for which the slot diff renderer is fetched
SlotDiffRenderer&$slotDiffRendererSlotDiffRenderer to change or replace
IContextSource$context
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\GetSlotDiffRendererHook.

Definition at line 1956 of file HookRunner.php.

◆ onGetUserBlock()

MediaWiki\HookContainer\HookRunner::onGetUserBlock ( $user,
$ip,
& $block )

Use this hook to modify the block found by the block manager.

This may be a single block or a composite block made from multiple blocks; the original blocks can be seen using CompositeBlock::getOriginalBlocks().

Since
1.35
Parameters
User$userUser targeted by the block
string | null$ipIP of the current request if $user is the current user and they're not exempted from IP blocks. Null otherwise.
AbstractBlock | null&$blockUser's block, or null if none was found
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Block\Hook\GetUserBlockHook.

Definition at line 1965 of file HookRunner.php.

◆ onGetUserPermissionsErrors()

MediaWiki\HookContainer\HookRunner::onGetUserPermissionsErrors ( $title,
$user,
$action,
& $result )

Use this hook to add a permissions error when permissions errors are checked for.

Use instead of userCan for most cases. Return false if the user can't do it, and populate $result with the reason in the form of [ messagename, param1, param2, ... ] or a MessageSpecifier instance (you might want to use ApiMessage to provide machine-readable details for the API).

Since
1.35
Parameters
Title$titleTitle being checked against
User$userCurrent user
string$actionAction being checked
array | string | MessageSpecifier&$resultUser permissions error to add. If none, return true. For consistency, error messages should be plain text with no special coloring, bolding, etc. to show that they're errors; presenting them properly to the user as errors is done by the caller.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\GetUserPermissionsErrorsHook.

Definition at line 1986 of file HookRunner.php.

◆ onGetUserPermissionsErrorsExpensive()

MediaWiki\HookContainer\HookRunner::onGetUserPermissionsErrorsExpensive ( $title,
$user,
$action,
& $result )

This hook is equal to getUserPermissionsErrors, but it is called only if expensive checks are enabled.

Use this hook to add a permissions error when permissions errors are checked for. Return false if the user can't do it, and populate $result with the reason in the form of [ messagename, param1, param2, ... ] or a MessageSpecifier instance (you might want to use ApiMessage to provide machine-readable details for the API).

Since
1.35
Parameters
Title$titleTitle being checked against
User$userCurrent user
string$actionAction being checked
array | string | MessageSpecifier&$resultUser permissions error to add. If none, return true. For consistency, error messages should be plain text with no special coloring, bolding, etc. to show that they're errors; presenting them properly to the user as errors is done by the caller.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\GetUserPermissionsErrorsExpensiveHook.

Definition at line 1993 of file HookRunner.php.

◆ onGitViewers()

MediaWiki\HookContainer\HookRunner::onGitViewers ( & $extTypes)

This hook is called when generating the list of git viewers for Special:Version, allowing you to modify the list.

Since
1.35
Parameters
string[]&$extTypesAssociative array of repo URLS to viewer URLs
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\GitViewersHook.

Definition at line 2002 of file HookRunner.php.

◆ onHistoryPageToolLinks()

MediaWiki\HookContainer\HookRunner::onHistoryPageToolLinks ( IContextSource $context,
LinkRenderer $linkRenderer,
array & $links )

Use this hook to add one or more links to revision history page subtitle.

Since
1.35
Parameters
IContextSource$context
LinkRenderer$linkRenderer
string[]&$linksArray of HTML strings
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\HistoryPageToolLinksHook.

Definition at line 2009 of file HookRunner.php.

◆ onHistoryTools()

MediaWiki\HookContainer\HookRunner::onHistoryTools ( $revRecord,
& $links,
$prevRevRecord,
$userIdentity )

Use this hook to override or extend the revision tools available from the page history view, i.e.

undo, rollback, etc.

Since
1.35
Parameters
RevisionRecord$revRecord
string[]&$linksArray of HTML links
RevisionRecord | null$prevRevRecordRevisionRecord object, next in line in page history, or null
UserIdentity$userIdentityCurrent user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\HistoryToolsHook.

Definition at line 2016 of file HookRunner.php.

Referenced by MediaWiki\Pager\PagerTools\__construct().

◆ onHtmlCacheUpdaterAppendUrls()

MediaWiki\HookContainer\HookRunner::onHtmlCacheUpdaterAppendUrls ( $title,
$mode,
& $append )

This hook is used to declare extra URLs to purge from HTTP caches.

Use $mode to decide whether to gather all related URLs or only those affected by a re-render of the same content. For example, after a direct revision to the content the history page will need to be purged. However when re-rendering after a cascading change from a template, only URLs that render content need purging. The $mode will be either HTMLCacheUpdater::PURGE_URLS_LINKSUPDATE_ONLY or 0.

Since
1.35
Parameters
Title$titleTitle of the page being updated
int$mode
array&$appendAppend URLs relating to the title
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\HtmlCacheUpdaterAppendUrlsHook.

Definition at line 2023 of file HookRunner.php.

◆ onHtmlCacheUpdaterVaryUrls()

MediaWiki\HookContainer\HookRunner::onHtmlCacheUpdaterVaryUrls ( $urls,
& $append )

This hook is used to add variants of URLs to purge from HTTP caches.

Extensions that provide site-wide variants of all URLs, such as by serving from an alternate domain or path, can use this hook to append alternative URLs for each url in $urls.

Since
1.35
Parameters
array$urlsCanonical URLs
array&$appendAppend alternative URLs for $urls
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\HtmlCacheUpdaterVaryUrlsHook.

Definition at line 2030 of file HookRunner.php.

◆ onHTMLFileCache__useFileCache()

MediaWiki\HookContainer\HookRunner::onHTMLFileCache__useFileCache ( $context)

Use this hook to override whether a page should be cached in file cache.

Since
1.35
Parameters
IContextSource$contextIContextSource object with information about the request being served
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\HTMLFileCache__useFileCacheHook.

Definition at line 2037 of file HookRunner.php.

◆ onHtmlPageLinkRendererBegin()

MediaWiki\HookContainer\HookRunner::onHtmlPageLinkRendererBegin ( $linkRenderer,
$target,
& $text,
& $customAttribs,
& $query,
& $ret )

This hook is called when generating internal and interwiki links in LinkRenderer, before processing starts.

Since
1.35
Parameters
LinkRenderer$linkRenderer
LinkTarget$targetLinkTarget that the link is pointing to
string | HtmlArmor | null&$textContents that the <a> tag should have; either a plain, unescaped string or an HtmlArmor object; null means "default"
string[]&$customAttribsHTML attributes that the <a> tag should have, in associative array form, with keys and values unescaped. Should be merged with default values, with a value of false meaning to suppress the attribute.
string[]&$queryQuery string to add to the generated URL (the bit after the "?"), in associative array form, with keys and values unescaped.
string&$retValue to return if your hook returns false
Returns
bool|void True or no return value to continue, or false to skip default processing and return $ret

Implements MediaWiki\Linker\Hook\HtmlPageLinkRendererBeginHook.

Definition at line 2044 of file HookRunner.php.

◆ onHtmlPageLinkRendererEnd()

MediaWiki\HookContainer\HookRunner::onHtmlPageLinkRendererEnd ( $linkRenderer,
$target,
$isKnown,
& $text,
& $attribs,
& $ret )

This hook is called when generating internal and interwiki links in LinkRenderer, just before the function returns a value.

Since
1.35
Parameters
LinkRenderer$linkRenderer
LinkTarget$targetLinkTarget object that the link is pointing to
bool$isKnownWhether the page is known or not
string | HtmlArmor&$textContents that the <a> tag should have; either a plain, unescaped string or an HtmlArmor object
string[]&$attribsFinal HTML attributes of the <a> tag, after processing, in associative array form
string&$retValue to return if your hook returns false
Returns
bool|void True or no return value to continue or false to abort. If you return true, an <a> element with HTML attributes $attribs and contents $html will be returned. If you return false, $ret will be returned.

Implements MediaWiki\Linker\Hook\HtmlPageLinkRendererEndHook.

Definition at line 2053 of file HookRunner.php.

◆ onImageBeforeProduceHTML()

MediaWiki\HookContainer\HookRunner::onImageBeforeProduceHTML ( $linker,
& $title,
& $file,
& $frameParams,
& $handlerParams,
& $time,
& $res,
$parser,
& $query,
& $widthOption )

This hook is called before producing the HTML created by a wiki image insertion.

You can skip the default logic entirely by returning false, or just modify a few things using call-by-reference.

Since
1.35
Parameters
DummyLinker$linkerDeprecated, do not use.
Title&$titleTitle object of the image
File | false&$fileFile object, or false if it doesn't exist
array&$frameParamsVarious parameters with special meanings; see documentation in includes/Linker.php for Linker::makeImageLink
array&$handlerParamsVarious parameters with special meanings; see documentation in includes/Linker.php for Linker::makeImageLink
string | bool&$timeTimestamp of file in 'YYYYMMDDHHIISS' string form, or false for current
string&$resFinal HTML output, used if you return false
Parser$parser
string&$queryQuery params for desc URL
string&$widthOptionUsed by the parser to remember the user preference thumbnailsize
Returns
bool|void True or no return value to continue or false to skip the default logic

Implements MediaWiki\Hook\ImageBeforeProduceHTMLHook.

Definition at line 2062 of file HookRunner.php.

◆ onImageOpenShowImageInlineBefore()

MediaWiki\HookContainer\HookRunner::onImageOpenShowImageInlineBefore ( $imagePage,
$output )

This hook is called just before showing the image on an image page.

Since
1.35
Parameters
ImagePage$imagePageImagePage object ($this)
OutputPage$output$wgOut
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ImageOpenShowImageInlineBeforeHook.

Definition at line 2072 of file HookRunner.php.

◆ onImagePageAfterImageLinks()

MediaWiki\HookContainer\HookRunner::onImagePageAfterImageLinks ( $imagePage,
& $html )

This hook is called after the image links section on an image page is built.

Since
1.35
Parameters
ImagePage$imagePageImagePage object ($this)
string&$htmlHTML for the hook to add
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ImagePageAfterImageLinksHook.

Definition at line 2079 of file HookRunner.php.

◆ onImagePageFileHistoryLine()

MediaWiki\HookContainer\HookRunner::onImagePageFileHistoryLine ( $imageHistoryList,
$file,
& $line,
& $css )

This hook is called when a file history line is constructed.

Since
1.35
Parameters
ImageHistoryList$imageHistoryListFormerly an ImagePage but since 1.27 it is an ImageHistoryList.
File$file
string&$lineHTML of the history line
string | null&$cssLine CSS class
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ImagePageFileHistoryLineHook.

Definition at line 2086 of file HookRunner.php.

◆ onImagePageFindFile()

MediaWiki\HookContainer\HookRunner::onImagePageFindFile ( $page,
& $file,
& $displayFile )

This hook is called when fetching the file associated with an image page.

Since
1.35
Parameters
ImagePage$page
File | false&$fileFalse on input, can be replaced with a File
File | false&$displayFileFalse on input, can be replaced with a file to display.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ImagePageFindFileHook.

Definition at line 2093 of file HookRunner.php.

◆ onImagePageShowTOC()

MediaWiki\HookContainer\HookRunner::onImagePageShowTOC ( $page,
& $toc )

This hook is called when the file toc on an image page is generated.

Since
1.35
Parameters
ImagePage$page
string[]&$tocArray of <li> strings
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ImagePageShowTOCHook.

Definition at line 2100 of file HookRunner.php.

◆ onImgAuthBeforeStream()

MediaWiki\HookContainer\HookRunner::onImgAuthBeforeStream ( & $title,
& $path,
& $name,
& $result )

This hook is called before a file is streamed to a user, but only when using img_auth.php.

Since
1.35
Parameters
Title&$titleTitle object of the file as it would appear for the upload page
string&$pathOriginal file and path name when img_auth was invoked by the web server
string&$nameName only component of the file
array&$resultLocation to pass back results of the hook routine (only used if failed)
  • $result[0]=The index of the header message
  • $result[1]=The index of the body text message
  • $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ImgAuthBeforeStreamHook.

Definition at line 2107 of file HookRunner.php.

References $path.

◆ onImgAuthModifyHeaders()

MediaWiki\HookContainer\HookRunner::onImgAuthModifyHeaders ( $title,
& $headers )

This hook is called just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand.

Since
1.35
Parameters
LinkTarget$title
string[]&$headersHTTP headers ( name => value, names are case insensitive ). Two headers get special handling: If-Modified-Since (value must be a valid HTTP date) and Range (must be of the form "bytes=(\\d*-\\d*)") will be honored when streaming the file.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ImgAuthModifyHeadersHook.

Definition at line 2114 of file HookRunner.php.

◆ onImportHandleContentXMLTag()

MediaWiki\HookContainer\HookRunner::onImportHandleContentXMLTag ( $reader,
$contentInfo )

This hook is called when parsing a content XML tag.

Since
1.36
Parameters
WikiImporter$reader
array$contentInfo
Returns
bool|void True or no return value to continue, or false to stop further processing of the tag

Implements MediaWiki\Hook\ImportHandleContentXMLTagHook.

Definition at line 2144 of file HookRunner.php.

◆ onImportHandleLogItemXMLTag()

MediaWiki\HookContainer\HookRunner::onImportHandleLogItemXMLTag ( $reader,
$logInfo )

This hook is called when parsing an XML tag in a log item.

Since
1.35
Parameters
WikiImporter$reader
array$logInfoArray of information
Returns
bool|void True or no return value to continue, or false to stop further processing of the tag

Implements MediaWiki\Hook\ImportHandleLogItemXMLTagHook.

Definition at line 2121 of file HookRunner.php.

◆ onImportHandlePageXMLTag()

MediaWiki\HookContainer\HookRunner::onImportHandlePageXMLTag ( $reader,
& $pageInfo )

This hook is called when parsing an XML tag in a page.

Since
1.35
Parameters
WikiImporter$reader
array&$pageInfoArray of information
Returns
bool|void True or no return value to continue, or false to stop further processing of the tag

Implements MediaWiki\Hook\ImportHandlePageXMLTagHook.

Definition at line 2128 of file HookRunner.php.

◆ onImportHandleRevisionXMLTag()

MediaWiki\HookContainer\HookRunner::onImportHandleRevisionXMLTag ( $reader,
$pageInfo,
$revisionInfo )

This hook is called when parsing an XML tag in a page revision.

Since
1.35
Parameters
WikiImporter$reader
array$pageInfoArray of page information
array$revisionInfoArray of revision information
Returns
bool|void True or no return value to continue, or false to stop further processing of the tag

Implements MediaWiki\Hook\ImportHandleRevisionXMLTagHook.

Definition at line 2135 of file HookRunner.php.

◆ onImportHandleToplevelXMLTag()

MediaWiki\HookContainer\HookRunner::onImportHandleToplevelXMLTag ( $reader)

This hook is called when parsing a top level XML tag.

Since
1.35
Parameters
WikiImporter$reader
Returns
bool|void True or no return value to continue, or false to stop further processing of the tag

Implements MediaWiki\Hook\ImportHandleToplevelXMLTagHook.

Definition at line 2150 of file HookRunner.php.

◆ onImportHandleUnknownUser()

MediaWiki\HookContainer\HookRunner::onImportHandleUnknownUser ( $name)

When a user doesn't exist locally, use this hook to auto-create it.

Since
1.35
Parameters
string$nameUsername
Returns
bool|void True or no return value to continue. If the auto-creation is successful, return false.

Implements MediaWiki\Hook\ImportHandleUnknownUserHook.

Definition at line 2157 of file HookRunner.php.

◆ onImportHandleUploadXMLTag()

MediaWiki\HookContainer\HookRunner::onImportHandleUploadXMLTag ( $reader,
$revisionInfo )

This hook is called when parsing an XML tag in a file upload.

Since
1.35
Parameters
WikiImporter$reader
array$revisionInfoArray of information
Returns
bool|void True or no return value to continue, or false to stop further processing of the tag

Implements MediaWiki\Hook\ImportHandleUploadXMLTagHook.

Definition at line 2164 of file HookRunner.php.

◆ onImportLogInterwikiLink()

MediaWiki\HookContainer\HookRunner::onImportLogInterwikiLink ( & $fullInterwikiPrefix,
& $pageTitle )

Use this hook to change interwiki links in log entries and edit summaries for transwiki imports.

Since
1.35
Parameters
string&$fullInterwikiPrefixInterwiki prefix, may contain colons.
string&$pageTitleString that contains page title.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ImportLogInterwikiLinkHook.

Definition at line 2171 of file HookRunner.php.

◆ onImportSources()

MediaWiki\HookContainer\HookRunner::onImportSources ( & $importSources)

This hook is called when reading from the $wgImportSources configuration variable.

This can be used to lazy-load the import sources list.

Since
1.35
Parameters
array&$importSourcesThe value of $wgImportSources. Modify as necessary. See \MediaWiki\MainConfigSchema::ImportSources.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ImportSourcesHook.

Definition at line 2178 of file HookRunner.php.

◆ onInfoAction()

MediaWiki\HookContainer\HookRunner::onInfoAction ( $context,
& $pageInfo )

This hook is called when building information to display on the action=info page.

Since
1.35
Parameters
IContextSource$context
array&$pageInfoArray of information, see InfoAction::pageInfo()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\InfoActionHook.

Definition at line 2185 of file HookRunner.php.

◆ onInitializeArticleMaybeRedirect()

MediaWiki\HookContainer\HookRunner::onInitializeArticleMaybeRedirect ( $title,
$request,
& $ignoreRedirect,
& $target,
& $article )

Use this hook to override whether a title is a redirect.

Since
1.35
Parameters
Title$titleTitle object for the current page
WebRequest$request
bool&$ignoreRedirectWhen set to true, the title will not redirect.
Title | string&$targetSet to an URL to do a HTTP redirect, or a Title to use that title instead of the original, without doing a HTTP redirect.
Article&$articleThe Article object that belongs to $title. Passed as a reference for legacy reasons, but should not be changed.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\InitializeArticleMaybeRedirectHook.

Definition at line 2192 of file HookRunner.php.

◆ onInternalParseBeforeLinks()

MediaWiki\HookContainer\HookRunner::onInternalParseBeforeLinks ( $parser,
& $text,
$stripState )

This hook is called during Parser's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processing.

Since
1.35
Parameters
Parser$parser
string&$textPartially parsed text
StripState$stripStateParser's internal StripState object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\InternalParseBeforeLinksHook.

Definition at line 2201 of file HookRunner.php.

◆ onInterwikiLoadPrefix()

MediaWiki\HookContainer\HookRunner::onInterwikiLoadPrefix ( $prefix,
& $iwData )

This hook is called when resolving whether a given prefix is an interwiki or not.

Since
1.35
Parameters
string$prefixInterwiki prefix we are looking for
array&$iwDataOutput array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid
Returns
bool|void True (or no return value) without providing an interwiki to continue interwiki search, or false to abort

Implements MediaWiki\Interwiki\Hook\InterwikiLoadPrefixHook.

Definition at line 2208 of file HookRunner.php.

◆ onInvalidateEmailComplete()

MediaWiki\HookContainer\HookRunner::onInvalidateEmailComplete ( $user)

This hook is called after a user's email has been invalidated successfully.

Since
1.35
Parameters
User$userUser whose email is being invalidated
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\InvalidateEmailCompleteHook.

Definition at line 2215 of file HookRunner.php.

◆ onIRCLineURL()

MediaWiki\HookContainer\HookRunner::onIRCLineURL ( & $url,
& $query,
$rc )

This hook is called when constructing the URL to use in an RCFeed notification.

Callee may modify $url and $query; URL will be constructed as $url . $query

Since
1.35
Parameters
string&$urlURL to index.php
string&$queryQuery string
RecentChange$rcRecentChange object that triggered URL generation
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\IRCLineURLHook.

Definition at line 2222 of file HookRunner.php.

◆ onIsFileCacheable()

MediaWiki\HookContainer\HookRunner::onIsFileCacheable ( $article)

Use this hook to override the result of Article::isFileCacheable().

Since
1.35
Parameters
Article$articleArticle being checked
Returns
bool|void True or no return value to override or false to abort

Implements MediaWiki\Page\Hook\IsFileCacheableHook.

Definition at line 2229 of file HookRunner.php.

◆ onIsTrustedProxy()

MediaWiki\HookContainer\HookRunner::onIsTrustedProxy ( $ip,
& $result )

Use this hook to override the result of ProxyLookup::isTrustedProxy().

Since
1.35
Parameters
string$ipIP being checked
bool&$resultChange this value to override the result of ProxyLookup::isTrustedProxy()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\IsTrustedProxyHook.

Definition at line 2236 of file HookRunner.php.

◆ onIsUploadAllowedFromUrl()

MediaWiki\HookContainer\HookRunner::onIsUploadAllowedFromUrl ( $url,
& $allowed )

Use this hook to override the result of UploadFromUrl::isAllowedUrl().

Since
1.35
Parameters
string$urlURL used to upload from
bool&$allowedWhether uploading is allowed for given URL
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\IsUploadAllowedFromUrlHook.

Definition at line 2243 of file HookRunner.php.

◆ onIsValidEmailAddr()

MediaWiki\HookContainer\HookRunner::onIsValidEmailAddr ( $addr,
& $result )

Use this hook to override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn't match your organization.

Since
1.35
Parameters
string$addrEmail address entered by the user
bool | null&$resultSet this and return false to override the internal checks
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\IsValidEmailAddrHook.

Definition at line 2250 of file HookRunner.php.

◆ onIsValidPassword()

MediaWiki\HookContainer\HookRunner::onIsValidPassword ( $password,
& $result,
$user )

Use this hook to override the result of User::isValidPassword()

Since
1.35
Parameters
string$passwordThe password entered by the user
bool | string | MessageSpecifier&$resultSet this and return false to override the internal checks
User$userUser the password is being validated for
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\IsValidPasswordHook.

Definition at line 2257 of file HookRunner.php.

◆ onJsonValidateSave()

MediaWiki\HookContainer\HookRunner::onJsonValidateSave ( JsonContent $content,
PageIdentity $pageIdentity,
StatusValue $status )

Use this hook to add additional validations for JSON content pages.

This hook is only called if JSON syntax validity and other contentmodel-specific validations are passing.

Since
1.39
Parameters
JsonContent$content
PageIdentity$pageIdentity
StatusValue$statusFatal errors only would trigger validation failure as $status is checked with isOK()
Returns
bool|void True or no return value to continue

Implements MediaWiki\Content\Hook\JsonValidateSaveHook.

Definition at line 2264 of file HookRunner.php.

◆ onLanguage__getMessagesFileName()

MediaWiki\HookContainer\HookRunner::onLanguage__getMessagesFileName ( $code,
& $file )

Use this hook to change the path of a localisation file.

Since
1.35
Parameters
string$codeLanguage code or the language we're looking for a messages file for
string&$fileMessages file path. You can override this to change the location.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Languages\Hook\Language__getMessagesFileNameHook.

Definition at line 2299 of file HookRunner.php.

◆ onLanguageGetNamespaces()

MediaWiki\HookContainer\HookRunner::onLanguageGetNamespaces ( & $namespaces)

Use this hook to provide custom ordering for namespaces or remove namespaces.

Do not use this hook to add namespaces. Use CanonicalNamespaces for that.

Since
1.35
Parameters
string[]&$namespacesArray of namespaces indexed by their numbers
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LanguageGetNamespacesHook.

Definition at line 2271 of file HookRunner.php.

◆ onLanguageGetTranslatedLanguageNames()

MediaWiki\HookContainer\HookRunner::onLanguageGetTranslatedLanguageNames ( & $names,
$code )

Use this hook to provide translated language names.

Since
1.35
Parameters
string[]&$namesArray of language code => language name
string$codeLanguage of the preferred translations
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Languages\Hook\LanguageGetTranslatedLanguageNamesHook.

Definition at line 2278 of file HookRunner.php.

◆ onLanguageLinks()

MediaWiki\HookContainer\HookRunner::onLanguageLinks ( $title,
& $links,
& $linkFlags )

Use this hook to manipulate a page's language links.

This hook is called in various places to allow extensions to define the effective language links for a page.

Since
1.35
Parameters
Title$title
string[]&$linksArray with elements of the form "language:title" in the order that they will be output
array&$linkFlagsAssociative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Output\Hook\LanguageLinksHook.

Definition at line 2285 of file HookRunner.php.

◆ onLanguageSelector()

MediaWiki\HookContainer\HookRunner::onLanguageSelector ( $out,
$cssClassName )

Use this hook to change the language selector available on a page.

Since
1.35
Parameters
OutputPage$outThe output page.
string$cssClassNameCSS class name of the language selector.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LanguageSelectorHook.

Definition at line 2292 of file HookRunner.php.

◆ onLinkerGenerateRollbackLink()

MediaWiki\HookContainer\HookRunner::onLinkerGenerateRollbackLink ( $revRecord,
$context,
$options,
& $inner )

This hook is called before a rollback link is displayed to allow for customizing the appearance of the link or substituting it with something entirely different.

The call to this hook is made after all checks, so the rollback should be valid.

See also
Linker::generateRollback()
Since
1.36
Parameters
RevisionRecord$revRecordThe top RevisionRecord that is being rolled back
IContextSource$contextThe context source provided to the method
array$optionsArray of options for the Linker::generateRollback() method
string&$innerHTML of the rollback link
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Linker\Hook\LinkerGenerateRollbackLinkHook.

Definition at line 2306 of file HookRunner.php.

◆ onLinkerMakeExternalImage()

MediaWiki\HookContainer\HookRunner::onLinkerMakeExternalImage ( & $url,
& $alt,
& $img )

This hook is called at the end of Linker::makeExternalImage() just before the return.

Since
1.35
Parameters
string&$urlImage URL
string&$altImage's alt text
string&$imgNew image HTML (if returning false)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LinkerMakeExternalImageHook.

Definition at line 2313 of file HookRunner.php.

◆ onLinkerMakeExternalLink()

MediaWiki\HookContainer\HookRunner::onLinkerMakeExternalLink ( & $url,
& $text,
& $link,
& $attribs,
$linkType )

This hook is called at the end of Linker::makeExternalLink() just before the return.

Since
1.35
Parameters
string&$urlLink URL
string&$textLink text
string&$linkNew link HTML (if returning false)
string[]&$attribsAttributes to be applied
string$linkTypeExternal link type
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LinkerMakeExternalLinkHook.

Definition at line 2320 of file HookRunner.php.

◆ onLinkerMakeMediaLinkFile()

MediaWiki\HookContainer\HookRunner::onLinkerMakeMediaLinkFile ( $title,
$file,
& $html,
& $attribs,
& $ret )

This hook is called at the end of Linker::makeMediaLinkFile() just before the return.

Since
1.35
Parameters
Title$titleTitle that the link is pointing to
File | bool$fileFile object or false if broken link
string&$htmlLink text
array&$attribsAttributes to be applied
string&$retValue to return if your hook returns false
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LinkerMakeMediaLinkFileHook.

Definition at line 2329 of file HookRunner.php.

◆ onLinksUpdate()

MediaWiki\HookContainer\HookRunner::onLinksUpdate ( $linksUpdate)

This hook is called at the beginning of LinksUpdate::doUpdate() just before the actual update.

Since
1.35
Parameters
LinksUpdate$linksUpdate
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LinksUpdateHook.

Definition at line 2338 of file HookRunner.php.

◆ onLinksUpdateComplete()

MediaWiki\HookContainer\HookRunner::onLinksUpdateComplete ( $linksUpdate,
$ticket )

This hook is called at the end of LinksUpdate::doUpdate() when updating, including delete and insert, has completed for all link tables.

Since
1.35
Parameters
LinksUpdate$linksUpdate
mixed$ticketPrior result of LBFactory::getEmptyTransactionTicket()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LinksUpdateCompleteHook.

Definition at line 2345 of file HookRunner.php.

◆ onListDefinedTags()

MediaWiki\HookContainer\HookRunner::onListDefinedTags ( & $tags)

This hook is called when trying to find all defined tags.

Since
1.35
Parameters
string[]&$tagsList of tags
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\ChangeTags\Hook\ListDefinedTagsHook.

Definition at line 2352 of file HookRunner.php.

Referenced by MediaWiki\ChangeTags\ChangeTagsStore\listSoftwareDefinedTags().

◆ onLoadExtensionSchemaUpdates()

MediaWiki\HookContainer\HookRunner::onLoadExtensionSchemaUpdates ( $updater)

This hook is called during database installation and updates.

Do not use this hook with a handler that uses a "services" or "optional_services" option in its ObjectFactory spec. It is called in a context where the global service locator is not initialised.

Since
1.35
Parameters
DatabaseUpdater$updaterDatabaseUpdater subclass
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook.

Definition at line 2359 of file HookRunner.php.

◆ onLoadUserOptions()

MediaWiki\HookContainer\HookRunner::onLoadUserOptions ( UserIdentity $user,
array & $options )

This hook is called when user options/preferences are being loaded from the database.

Since
1.37
Parameters
UserIdentity$user
array&$optionsOptions, can be modified.
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\User\Options\Hook\LoadUserOptionsHook.

Definition at line 4328 of file HookRunner.php.

◆ onLocalFile__getHistory()

MediaWiki\HookContainer\HookRunner::onLocalFile__getHistory ( $file,
& $tables,
& $fields,
& $conds,
& $opts,
& $join_conds )

This hook is called before a file history query is performed.

Since
1.35
Parameters
File$file
array&$tables
array&$fieldsSelect fields
array&$condsConditions
array&$optsQuery options
array&$join_condsJOIN conditions
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LocalFile__getHistoryHook.

Definition at line 2374 of file HookRunner.php.

◆ onLocalFilePurgeThumbnails()

MediaWiki\HookContainer\HookRunner::onLocalFilePurgeThumbnails ( $file,
$archiveName,
$urls )

This hook is called before thumbnails for a local file are purged.

Since
1.35
Parameters
File$fileThe File of which the thumbnails are being purged
string | false$archiveNameName of an old file version or false if it's the current one
array$urlsUrls to be purged
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LocalFilePurgeThumbnailsHook.

Definition at line 2367 of file HookRunner.php.

◆ onLocalisationCacheRecache()

MediaWiki\HookContainer\HookRunner::onLocalisationCacheRecache ( $cache,
$code,
& $alldata,
$unused )

Called when loading the localisation data into cache.

Since
1.35
Parameters
?mixed$cacheThe LocalisationCache object
?mixed$codelanguage code
?mixed&$alldataThe localisation data from core and extensions
?mixed$unusedUsed to be $purgeBlobs, removed in 1.34
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LocalisationCacheRecacheHook.

Definition at line 2383 of file HookRunner.php.

◆ onLocalisationCacheRecacheFallback()

MediaWiki\HookContainer\HookRunner::onLocalisationCacheRecacheFallback ( $cache,
$code,
& $alldata )

Called for each language when merging fallback data into the cache.

Since
1.35
Parameters
?mixed$cacheThe LocalisationCache object
?mixed$codelanguage code
?mixed&$alldataThe localisation data from core and extensions. Note some keys may be omitted if they won't be merged into the final result.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LocalisationCacheRecacheFallbackHook.

Definition at line 2390 of file HookRunner.php.

◆ onLocalUserCreated()

MediaWiki\HookContainer\HookRunner::onLocalUserCreated ( $user,
$autocreated )

This hook is called when a local user has been created.

After this hook User::saveSettings is called to save all modification done in the hook handlers, like changed user properties or changed user preferences.

Since
1.35
Parameters
User$userUser object for the created user
bool$autocreatedWhether this was an auto-creation
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Auth\Hook\LocalUserCreatedHook.

Definition at line 2397 of file HookRunner.php.

◆ onLogEventsListGetExtraInputs()

MediaWiki\HookContainer\HookRunner::onLogEventsListGetExtraInputs ( $type,
$logEventsList,
& $unused,
& $formDescriptor )

This hook is called when getting extra inputs to display on Special:Log for a specific log type.

Since
1.35
Parameters
string$typeLog type being displayed
LogEventsList$logEventsListLogEventsList object for context and access to the WebRequest
string&$unused
array&$formDescriptorHTMLForm's form descriptor
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LogEventsListGetExtraInputsHook.

Definition at line 2404 of file HookRunner.php.

◆ onLogEventsListLineEnding()

MediaWiki\HookContainer\HookRunner::onLogEventsListLineEnding ( $page,
& $ret,
$entry,
& $classes,
& $attribs )

This hook is called before a Special:Log line is finished.

Since
1.35
Parameters
LogEventsList$page
string&$retHTML line
DatabaseLogEntry$entryDatabaseLogEntry object for this row
string[]&$classesClasses to add to the surrounding <li>
array&$attribsAssociative array of other HTML attributes for the <li> element. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LogEventsListLineEndingHook.

Definition at line 2413 of file HookRunner.php.

◆ onLogEventsListShowLogExtract()

MediaWiki\HookContainer\HookRunner::onLogEventsListShowLogExtract ( & $s,
$types,
$page,
$user,
$param )

This hook is called before the string is added to OutputPage.

Since
1.35
Parameters
string&$sHTML to show for the log extract
string | array$typesLog types to show
string | null$pagePage title to show log entries for
string$userUser who made the log entries
array$paramAssociative array with the following additional options:
  • lim (integer): Limit of items to show, default is 50
  • conds (array): Extra conditions for the query (e.g. "log_action != 'revision'")
  • showIfEmpty (boolean): Set to false if you don't want any output in case the loglist is empty if set to true (default), "No matching items in log" is displayed if loglist is empty
  • msgKey (array): If you want a nice box with a message, set this to the key of the message. First element is the message key, additional optional elements are parameters for the key that are processed with wfMessage()->params()->parseAsBlock()
  • offset: Set to overwrite offset parameter in $wgRequest set to '' to unset offset
  • wrap (string): Wrap the message in html (usually something like "&lt;div ...>$1&lt;/div>")
  • flags (integer): Display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
Returns
bool|void True or no return value to continue, or false to prevent the string from being added to the OutputPage

Implements MediaWiki\Hook\LogEventsListShowLogExtractHook.

Definition at line 2422 of file HookRunner.php.

Referenced by LogEventsList\showLogExtract().

◆ onLogException()

MediaWiki\HookContainer\HookRunner::onLogException ( $e,
$suppressed )

This hook is called before an exception (or PHP error) is logged.

This is meant for integration with external error aggregation services; returning false will NOT prevent logging.

Since
1.35
Parameters
Exception | ErrorException$eException (in case of a plain old PHP error, a wrapping ErrorException)
bool$suppressedTrue if the error was suppressed via error_reporting()/wfSuppressWarnings()
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LogExceptionHook.

Definition at line 2431 of file HookRunner.php.

◆ onLoginFormValidErrorMessages()

MediaWiki\HookContainer\HookRunner::onLoginFormValidErrorMessages ( array & $messages)

This hook is called in LoginForm when a function gets valid error messages.

This hook allows extensions to add additional error messages (except messages already in LoginForm::$validErrorMessages).

Since
1.35
Parameters
string[]&$messagesAlready added message keys (including message keys from LoginForm::$validErrorMessages)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LoginFormValidErrorMessagesHook.

Definition at line 2438 of file HookRunner.php.

◆ onLogLine()

MediaWiki\HookContainer\HookRunner::onLogLine ( $log_type,
$log_action,
$title,
$paramArray,
& $comment,
& $revert,
$time )

Use this hook to process a single log entry on Special:Log.

Since
1.35
Parameters
string$log_typeType of log entry (e.g. 'move'). Corresponds to logging.log_type database field.
string$log_actionType of log action (e.g. 'delete', 'block', 'create2'). Corresponds to logging.log_action database field.
Title$titleTitle object that corresponds to logging.log_namespace and logging.log_title database fields
array$paramArrayParameters that correspond to logging.log_params field. Note that only $paramArray[0] appears to contain anything.
string&$commentLogging.log_comment database field, which is displayed in the UI
string&$revertString that is displayed in the UI, similar to $comment
string$timeTimestamp of the log entry (added in 1.12)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LogLineHook.

Definition at line 2445 of file HookRunner.php.

◆ onLonelyPagesQuery()

MediaWiki\HookContainer\HookRunner::onLonelyPagesQuery ( & $tables,
& $conds,
& $joinConds )

Use this hook to modify the query used by Special:LonelyPages.

Since
1.35
Parameters
array&$tablestables to join in the query
array&$condsconditions for the query
array&$joinCondsjoin conditions for the query
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\LonelyPagesQueryHook.

Definition at line 2455 of file HookRunner.php.

◆ onMagicWordwgVariableIDs()

MediaWiki\HookContainer\HookRunner::onMagicWordwgVariableIDs ( & $variableIDs)

This hook is called when defining new magic words IDs.

Since
1.35
Parameters
string[]&$variableIDs
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MagicWordwgVariableIDsHook.

Definition at line 2462 of file HookRunner.php.

◆ onMaintenanceRefreshLinksInit()

MediaWiki\HookContainer\HookRunner::onMaintenanceRefreshLinksInit ( $refreshLinks)

This hook is called before executing the refreshLinks.php maintenance script.

Since
1.35
Parameters
RefreshLinks$refreshLinks
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MaintenanceRefreshLinksInitHook.

Definition at line 2469 of file HookRunner.php.

◆ onMaintenanceShellStart()

MediaWiki\HookContainer\HookRunner::onMaintenanceShellStart ( )

This hook is called before maintenance script shells start, such as eval.php and shell.php.

Since
1.36
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Hook\MaintenanceShellStartHook.

Definition at line 2476 of file HookRunner.php.

◆ onMaintenanceUpdateAddParams()

MediaWiki\HookContainer\HookRunner::onMaintenanceUpdateAddParams ( & $params)

Use this hook to add params to the update.php maintenance script.

Since
1.35
Parameters
array&$paramsArray to populate with the params to be added. Array elements are keyed by the param name. Each param is an associative array that must include the following keys:
  • desc: The description of the param to show on –help
  • require: Is the param required? Defaults to false if not set.
  • withArg: Is an argument required with this option? Defaults to false if not set.
  • shortName: Character to use as short name, or false if none. Defaults to false if not set.
  • multiOccurrence: Can this option be passed multiple times? Defaults to false if not set.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MaintenanceUpdateAddParamsHook.

Definition at line 2484 of file HookRunner.php.

References $params.

◆ onMakeGlobalVariablesScript()

MediaWiki\HookContainer\HookRunner::onMakeGlobalVariablesScript ( & $vars,
$out )

Export user- or page-specific mw.config variables to JavaScript.

When using this hook, be as selective as possible about when the data is set. Reduce the cost by setting values only for specific titles, namespaces, or user-rights.

Data exported here is transmitted with the highest possible bandwidth priority (ahead of page content even). Any data that is not dependant on the current request, should go through MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook instead.

This hook is called from OutputPage::getJSVars.

Since
1.35
Parameters
array&$varsVariable (or multiple variables)
OutputPage$outOutputPage which called the hook, can be used to get the real title
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Output\Hook\MakeGlobalVariablesScriptHook.

Definition at line 2491 of file HookRunner.php.

◆ onManualLogEntryBeforePublish()

MediaWiki\HookContainer\HookRunner::onManualLogEntryBeforePublish ( $logEntry)

Use this hook to access or modify log entry just before it is published.

Since
1.35
Parameters
ManualLogEntry$logEntry
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Hook\ManualLogEntryBeforePublishHook.

Definition at line 2499 of file HookRunner.php.

◆ onMarkPatrolled()

MediaWiki\HookContainer\HookRunner::onMarkPatrolled ( $rcid,
$user,
$wcOnlySysopsCanPatrol,
$auto,
& $tags )

This hook is called before an edit is marked patrolled.

Since
1.35
Parameters
int$rcidID of the revision to be marked patrolled
User$userUser marking the revision as patrolled
bool$wcOnlySysopsCanPatrolAlways false
bool$autoAlways false
string[]&$tagsTags to be applied to the patrol log entry
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MarkPatrolledHook.

Definition at line 2507 of file HookRunner.php.

◆ onMarkPatrolledComplete()

MediaWiki\HookContainer\HookRunner::onMarkPatrolledComplete ( $rcid,
$user,
$wcOnlySysopsCanPatrol,
$auto )

This hook is called after an edit is marked patrolled.

Since
1.35
Parameters
int$rcidID of the revision marked as patrolled
User$userUser who marked the edit patrolled
bool$wcOnlySysopsCanPatrolAlways false
bool$autoAlways false
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MarkPatrolledCompleteHook.

Definition at line 2516 of file HookRunner.php.

◆ onMediaWikiPerformAction()

MediaWiki\HookContainer\HookRunner::onMediaWikiPerformAction ( $output,
$article,
$title,
$user,
$request,
$mediaWiki )

Use this hook to override ActionEntryPoint::performAction().

Use this to do something completely different, after the basic globals have been set up, but before ordinary actions take place.

Since
1.35
Parameters
OutputPage$outputContext output
Article$articleArticle on which the action will be performed
Title$titleTitle on which the action will be performed
User$userContext user
WebRequest$requestContext request
ActionEntryPoint$mediaWiki(Changed from MediaWiki in 1.42)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MediaWikiPerformActionHook.

Definition at line 2525 of file HookRunner.php.

◆ onMediaWikiServices()

MediaWiki\HookContainer\HookRunner::onMediaWikiServices ( $services)

This hook is called when a global MediaWikiServices instance is initialized.

Extensions may use this to define, replace, or wrap services. However, the preferred way to define a new service is the $wgServiceWiringFiles array.

Warning
Implementations must not immediately access services instances from the service container $services, since the service container is not fully initialized at the time when the hook is called. However, callbacks that are used as service instantiators or service manipulators may access service instances.

Example:

function onMediaWikiServices( $services ) {
// The service wiring and configuration in $services may be incomplete at this time,
// do not access services yet!
// At this point, we can only manipulate the wiring, not use it!
$services->defineService(
'MyCoolService',
function( MediaWikiServices $container ) {
// It's ok to access services inside this callback, since the
// service container will be fully initialized when it is called!
return new MyCoolService( $container->getPageLookup() );
}
);
$services->addServiceManipulator(
'SlotRoleRegistry',
function ( SlotRoleRegistry $service, MediaWikiServices $container ) {
// ...
}
);
$services->redefineService(
'StatsdDataFactory',
function ( MediaWikiServices $container ) {
// ...
}
);
}
Service locator for MediaWiki core services.
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page.
Since
1.35
Parameters
MediaWikiServices$services
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MediaWikiServicesHook.

Definition at line 2534 of file HookRunner.php.

◆ onMessageCache__get()

MediaWiki\HookContainer\HookRunner::onMessageCache__get ( & $key)

This hook is called when fetching a message.

Use this hook to override the key for customisations. Given and returned message key must be formatted with: 1) the first letter in lower case according to the content language 2) spaces replaced with underscores

Since
1.35
Parameters
string&$keyMessage key
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\MessageCache__getHook.

Definition at line 2557 of file HookRunner.php.

◆ onMessageCacheFetchOverrides()

MediaWiki\HookContainer\HookRunner::onMessageCacheFetchOverrides ( array & $keys)

This hook is called to fetch overrides.

Use this hook to override message keys for customisations. Returned messages key must be formatted with: 1) the first letter in lower case according to the content language 2) spaces replaced with underscores

Since
1.41
Parameters
(string|callable)[]&$keys Message keys mapped to their override. Values may also be a callable that returns a message key. Callables are passed the message key, the MessageCache instance, a Language/StubUserLang object and a boolean indicating if the value should be fetched from the database. Note that strings will always be interpreted as a message key; this is not valid callable syntax! This prevents ambiguity between message keys and functions. Use Closure::fromCallable or another valid callable syntax.

Implements MediaWiki\Cache\Hook\MessageCacheFetchOverridesHook.

Definition at line 2542 of file HookRunner.php.

◆ onMessageCacheReplace()

MediaWiki\HookContainer\HookRunner::onMessageCacheReplace ( $title,
$text )

This hook is called when a message page is changed.

Use this hook to update caches.

Since
1.35
Parameters
string$titleName of the page changed
string$textNew contents of the page
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\MessageCacheReplaceHook.

Definition at line 2550 of file HookRunner.php.

◆ onMessagesPreLoad()

MediaWiki\HookContainer\HookRunner::onMessagesPreLoad ( $title,
& $message,
$code )

This hook is called when loading a message from the database.

Since
1.35
Parameters
string$titleTitle of the message
string&$messageMessage you want to define
string$codeLanguage code
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Cache\Hook\MessagesPreLoadHook.

Definition at line 2564 of file HookRunner.php.

◆ onMimeMagicGuessFromContent()

MediaWiki\HookContainer\HookRunner::onMimeMagicGuessFromContent ( $mimeMagic,
& $head,
& $tail,
$file,
& $mime )

Use this hook to guess the MIME by content.

Since
1.35
Parameters
MimeAnalyzer$mimeMagic
string&$headFirst 1024 bytes of the file in a string (in - Do not alter!)
string&$tailMore or equal than last 65558 bytes of the file in a string (in - Do not alter!)
string$fileFile path
string&$mimeMIME type (out)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MimeMagicGuessFromContentHook.

Definition at line 2571 of file HookRunner.php.

◆ onMimeMagicImproveFromExtension()

MediaWiki\HookContainer\HookRunner::onMimeMagicImproveFromExtension ( $mimeMagic,
$ext,
& $mime )

Use this hook to further improve the MIME type detected by considering the file extension.

Since
1.35
Parameters
MimeAnalyzer$mimeMagic
string$extFile extension
string&$mimeMIME type (in/out)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MimeMagicImproveFromExtensionHook.

Definition at line 2580 of file HookRunner.php.

◆ onMimeMagicInit()

MediaWiki\HookContainer\HookRunner::onMimeMagicInit ( $mimeMagic)

This hook is called before processing the list mapping MIME types to media types and the list mapping MIME types to file extensions.

As an extension author, you are encouraged to submit patches to MediaWiki's core to add new MIME types to mime.types.

Since
1.35
Parameters
MimeAnalyzer$mimeMagic
  • Use $mimeMagic->addExtraInfo( $stringOfInfo ); for adding new MIME info to the list.
  • Use $mimeMagic->addExtraTypes( $stringOfTypes ); for adding new MIME types to the list.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MimeMagicInitHook.

Definition at line 2587 of file HookRunner.php.

◆ onModifyExportQuery()

MediaWiki\HookContainer\HookRunner::onModifyExportQuery ( $db,
& $tables,
$cond,
& $opts,
& $join_conds,
& $conds )

Use this hook to modify the query used by the exporter.

Since
1.35
Parameters
IReadableDatabase$dbDatabase object to be queried
array&$tablesTables in the query
string$condAn SQL fragment included in the WHERE clause which is used to filter the results, for example to a specific page. Since 1.31, modification of this parameter has no effect. Since 1.35, you can use $conds instead to modify the array of conditions passed to IReadableDatabase::select().
array&$optsOptions for the query
array&$join_condsJoin conditions for the query
array&$condsThe array of conditions to be passed to IReadableDatabase::select(). Can be modified. Includes the value of $cond.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ModifyExportQueryHook.

Definition at line 2601 of file HookRunner.php.

◆ onMovePageCheckPermissions()

MediaWiki\HookContainer\HookRunner::onMovePageCheckPermissions ( $oldTitle,
$newTitle,
$user,
$reason,
$status )

Use this hook to specify whether the user is allowed to move the page.

Since
1.35
Parameters
Title$oldTitleCurrent (old) location
Title$newTitleNew location
User$userUser making the move
string | null$reasonReason provided by the user
Status$statusStatus object to pass error messages to
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MovePageCheckPermissionsHook.

Definition at line 2610 of file HookRunner.php.

◆ onMovePageIsValidMove()

MediaWiki\HookContainer\HookRunner::onMovePageIsValidMove ( $oldTitle,
$newTitle,
$status )

Use this hook to specify whether a page can be moved for technical reasons.

Since
1.35
Parameters
Title$oldTitleCurrent (old) location
Title$newTitleNew location
Status$statusStatus object to pass error messages to
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\MovePageIsValidMoveHook.

Definition at line 2619 of file HookRunner.php.

◆ onMultiContentSave()

MediaWiki\HookContainer\HookRunner::onMultiContentSave ( $renderedRevision,
$user,
$summary,
$flags,
$status )

This hook is called before an article is saved.

Since
1.35
Parameters
RenderedRevision$renderedRevisionPlanned revision. Provides access to: (1) ParserOutput of all slots, (2) RevisionRecord, which contains (2a) Title of the page that will be edited, (2b) RevisionSlots - content of all slots, including inherited slots, where content has already been modified by PreSaveTransform. NOTE: because this revision is not yet saved, slots don't have content ID or address, and revision itself doesn't have an ID.
UserIdentity$userAuthor of this new revision
CommentStoreComment$summaryUser-provided edit comment/summary (not an autosummary: will be empty if the user hasn't provided a comment)
int$flagsCombination of EDIT_* flags, e.g. EDIT_MINOR
Status$statusIf the hook is aborted, error code can be placed into this Status
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Storage\Hook\MultiContentSaveHook.

Definition at line 2626 of file HookRunner.php.

◆ onNamespaceIsMovable()

MediaWiki\HookContainer\HookRunner::onNamespaceIsMovable ( $index,
& $result )

This hook is called when determining if it is possible to move pages in a namespace.

Since
1.35
Parameters
int$indexIndex of the namespace being checked
bool&$resultWhether MediaWiki currently thinks that pages in this namespace are movable. Hooks may change this value to override the return value of NamespaceInfo::isMovable().
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\NamespaceIsMovableHook.

Definition at line 2635 of file HookRunner.php.

◆ onNewDifferenceEngine()

MediaWiki\HookContainer\HookRunner::onNewDifferenceEngine ( $title,
& $oldId,
& $newId,
$old,
$new )

This hook is called when a new DifferenceEngine object is made.

Since
1.35
Parameters
Title | null$titleDiff page title
int | false | null&$oldIdActual old ID to use in the diff
int | false | null&$newIdActual new Id to use in the diff (0 means current)
int$old?old= param value from the URL
int$new?new= param value from the URL
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Diff\Hook\NewDifferenceEngineHook.

Definition at line 2642 of file HookRunner.php.

◆ onNewPagesLineEnding()

MediaWiki\HookContainer\HookRunner::onNewPagesLineEnding ( $pager,
& $ret,
$row,
& $classes,
& $attribs )

This hook is called before a NewPages line is finished.

Since
1.35
Parameters
NewPagesPager$pager
string&$retthe HTML line
stdClass$rowThe database row for this page (the recentchanges record and a few extras
  • see NewPagesPager::getQueryInfo)
string[]&$classesThe classes to add to the surrounding
string[]&$attribsAssociative array of other HTML attributes for the element. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\NewPagesLineEndingHook.

Definition at line 2649 of file HookRunner.php.

◆ onOldChangesListRecentChangesLine()

MediaWiki\HookContainer\HookRunner::onOldChangesListRecentChangesLine ( $changeslist,
& $s,
$rc,
& $classes,
& $attribs )

Use this hook to customize a recent changes line.

Since
1.35
Parameters
OldChangesList$changeslist
string&$sHTML of the form <li>...</li> containing one RC entry
RecentChange$rc
string[]&$classesArray of CSS classes for the <li> element
string[]&$attribsAssociative array of other HTML attributes for the <li> element. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).
Returns
bool|void True or no return value to continue, or false to omit the line from RecentChanges and Watchlist special pages

Implements MediaWiki\Hook\OldChangesListRecentChangesLineHook.

Definition at line 2656 of file HookRunner.php.

◆ onOpenSearchUrls()

MediaWiki\HookContainer\HookRunner::onOpenSearchUrls ( & $urls)

This hook is called when constructing the OpenSearch description XML.

Hooks can alter or append to the array of URLs for search & suggestion formats.

Since
1.35
Parameters
array[]&$urlsArray of associative arrays with URL element attributes
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\OpenSearchUrlsHook.

Definition at line 2665 of file HookRunner.php.

◆ onOpportunisticLinksUpdate()

MediaWiki\HookContainer\HookRunner::onOpportunisticLinksUpdate ( $page,
$title,
$parserOutput )

This hook is called by WikiPage::triggerOpportunisticLinksUpdate when a page view triggers a re-rendering of the page.

This may happen particularly if the parser cache is split by user language, and no cached rendering of the page exists in the user's language. The hook is called before checking whether page_links_updated indicates that the links are up to date.

Since
1.35
Parameters
WikiPage$pageWikiPage that was rendered
Title$titleTitle of the rendered page
ParserOutput$parserOutputParserOutput resulting from rendering the page
Returns
bool|void True or no return value to continue, or false to abort triggerOpportunisticLinksUpdate() without triggering any updates

Implements MediaWiki\Page\Hook\OpportunisticLinksUpdateHook.

Definition at line 2672 of file HookRunner.php.

◆ onOtherAutoblockLogLink()

MediaWiki\HookContainer\HookRunner::onOtherAutoblockLogLink ( & $otherBlockLink)

Use this hook to add list items to a list of "other autoblocks" which appears at the end of Special:AutoblockList.

Handlers should append HTML fragments to the $otherBlockLink array.

Since
1.35
Parameters
string[]&$otherBlockLinkAn array of HTML fragments
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\OtherAutoblockLogLinkHook.

Definition at line 2679 of file HookRunner.php.

◆ onOtherBlockLogLink()

MediaWiki\HookContainer\HookRunner::onOtherBlockLogLink ( & $otherBlockLink,
$ip )

Use this hook to add list items to a list of "other blocks" when viewing Special:BlockList.

Handlers should append HTML fragments to the $otherBlockLink array.

Since
1.35
Parameters
string[]&$otherBlockLinkArray of HTML fragments
string$ipThe requested IP address or username, or an empty string if Special:BlockList is showing all blocks.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\OtherBlockLogLinkHook.

Definition at line 2686 of file HookRunner.php.

◆ onOutputPageAfterGetHeadLinksArray()

MediaWiki\HookContainer\HookRunner::onOutputPageAfterGetHeadLinksArray ( & $tags,
$out )

This hook is called in OutputPage::getHeadLinksArray right before returning the result.

Since
1.35
Parameters
array&$tagsArray containing all <head> links generated so far. The array format is "link name or number => 'link HTML'".
OutputPage$out
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Output\Hook\OutputPageAfterGetHeadLinksArrayHook.

Definition at line 2693 of file HookRunner.php.

◆ onOutputPageBeforeHTML()

MediaWiki\HookContainer\HookRunner::onOutputPageBeforeHTML ( $out,
& $text )

This hook is called when a page has been processed by the parser and the resulting HTML is about to be displayed.

Since
1.35
Parameters
OutputPage$outOutputPage object that corresponds to the page
string&$textText that will be displayed, in HTML
Returns
bool|void This hook must not abort, it must return true or null.

Implements MediaWiki\Output\Hook\OutputPageBeforeHTMLHook.

Definition at line 2700 of file HookRunner.php.

◆ onOutputPageBodyAttributes()

MediaWiki\HookContainer\HookRunner::onOutputPageBodyAttributes ( $out,
$sk,
& $bodyAttrs )

This hook is called when OutputPage::headElement is creating the body tag to allow for extensions to add attributes to the body of the page they might need.

Or to allow building extensions to add body classes that aren't of high enough demand to be included in core.

Since
1.35
Parameters
OutputPage$outOutputPage which called the hook, can be used to get the real title
Skin$skSkin that called OutputPage::headElement
string[]&$bodyAttrsArray of attributes for the body tag passed to Html::openElement
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Output\Hook\OutputPageBodyAttributesHook.

Definition at line 2707 of file HookRunner.php.

◆ onOutputPageCheckLastModified()

MediaWiki\HookContainer\HookRunner::onOutputPageCheckLastModified ( & $modifiedTimes,
$out )

This hook is called when checking if the page has been modified since the last visit.

Since
1.35
Parameters
string[]&$modifiedTimesArray of timestamps. The following keys are set: page, user, epoch.
OutputPage$outsince 1.28
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Output\Hook\OutputPageCheckLastModifiedHook.

Definition at line 2715 of file HookRunner.php.

◆ onOutputPageMakeCategoryLinks()

MediaWiki\HookContainer\HookRunner::onOutputPageMakeCategoryLinks ( $out,
$categories,
& $links )

This hook is called when links are about to be generated for the page's categories.

Since
1.35
Parameters
OutputPage$out
string[]$categoriesAssociative array in which keys are category names and values are category types ("normal" or "hidden")
array&$linksIntended to hold the result. Associative array with category types as keys and arrays of HTML links as values.
Returns
bool|void True or no return value to continue. Implementations should return false if they generate the category links, so the default link generation is skipped.

Implements MediaWiki\Output\Hook\OutputPageMakeCategoryLinksHook.

Definition at line 2722 of file HookRunner.php.

◆ onOutputPageParserOutput()

MediaWiki\HookContainer\HookRunner::onOutputPageParserOutput ( $outputPage,
$parserOutput )

This hook is called after adding a parserOutput to $wgOut.

Since
1.35
Parameters
OutputPage$outputPage
ParserOutput$parserOutputParserOutput instance being added in $outputPage
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Output\Hook\OutputPageParserOutputHook.

Definition at line 2729 of file HookRunner.php.

◆ onPageContentLanguage()

MediaWiki\HookContainer\HookRunner::onPageContentLanguage ( $title,
& $pageLang,
$userLang )

Use this hook to change the language in which the content of a page is written.

Defaults to the wiki content language.

Since
1.35
Parameters
Title$title
Language&$pageLangPage content language
mixed$userLangUnused (always null), T299369
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\PageContentLanguageHook.

Definition at line 2737 of file HookRunner.php.

◆ onPageContentSave()

MediaWiki\HookContainer\HookRunner::onPageContentSave ( $wikiPage,
$user,
$content,
& $summary,
$isminor,
$iswatch,
$section,
$flags,
$status )

This hook is called before an article is saved.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage being saved
User$userUser saving the article
Content$contentNew article content
CommentStoreComment&$summaryEdit comment. Can be replaced with a new one.
bool$isminorWhether the edit was marked as minor
null$iswatchPreviously a watch flag. Currently unused, always null.
null$sectionPreviously the section number being edited. Currently unused, always null.
int$flagsAll EDIT_… flags (including EDIT_MINOR) as an integer number. See WikiPage::doUserEditContent documentation for flags' definition.
StatusValue$statusStatusValue object for the hook handlers resulting status. Either set $status->fatal() or return false to abort the save action.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Storage\Hook\PageContentSaveHook.

Definition at line 2744 of file HookRunner.php.

◆ onPageDelete()

MediaWiki\HookContainer\HookRunner::onPageDelete ( ProperPageIdentity $page,
Authority $deleter,
string $reason,
StatusValue $status,
bool $suppress )

This hook is called before a page is deleted.

Since
1.37
Parameters
ProperPageIdentity$pagePage being deleted.
Authority$deleterWho is deleting the page
string$reasonReason the page is being deleted
StatusValue$statusAdd any error here
bool$suppressWhether this is a suppression deletion or not
Returns
bool|void True or no return value to continue; false to abort, which also requires adding a fatal error to $status.

Implements MediaWiki\Page\Hook\PageDeleteHook.

Definition at line 2754 of file HookRunner.php.

◆ onPageDeleteComplete()

MediaWiki\HookContainer\HookRunner::onPageDeleteComplete ( ProperPageIdentity $page,
Authority $deleter,
string $reason,
int $pageID,
RevisionRecord $deletedRev,
ManualLogEntry $logEntry,
int $archivedRevisionCount )

This hook is called after a page is deleted.

Since
1.37
Parameters
ProperPageIdentity$pagePage that was deleted. This object represents state before deletion (e.g. $page->exists() will return true).
Authority$deleterWho deleted the page
string$reasonReason the page was deleted
int$pageIDID of the page that was deleted
RevisionRecord$deletedRevLast revision of the deleted page
ManualLogEntry$logEntryManualLogEntry used to record the deletion
int$archivedRevisionCountNumber of revisions archived during the deletion
Returns
true|void

Implements MediaWiki\Page\Hook\PageDeleteCompleteHook.

Definition at line 2767 of file HookRunner.php.

◆ onPageDeletionDataUpdates()

MediaWiki\HookContainer\HookRunner::onPageDeletionDataUpdates ( $title,
$revision,
& $updates )

This hook is called when constructing a list of DeferrableUpdate to be executed when a page is deleted.

Since
1.35
Parameters
Title$titleTitle of the page being deleted
RevisionRecord$revisionRevisionRecord representing the page's current revision at the time of deletion
DeferrableUpdate[]&$updatesList of DeferrableUpdate that can be manipulated by the hook handler
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\PageDeletionDataUpdatesHook.

Definition at line 2782 of file HookRunner.php.

◆ onPageHistoryBeforeList()

MediaWiki\HookContainer\HookRunner::onPageHistoryBeforeList ( $article,
$context )

This hook is called when a history page list is about to be constructed.

Since
1.35
Parameters
Article$articleThe article that the history is loading for
IContextSource$context
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PageHistoryBeforeListHook.

Definition at line 2830 of file HookRunner.php.

◆ onPageHistoryLineEnding()

MediaWiki\HookContainer\HookRunner::onPageHistoryLineEnding ( $historyAction,
& $row,
& $s,
& $classes,
& $attribs )

This hook is called right before the <li> is generated for a history line.

Since
1.35
Parameters
HistoryPager$historyAction
stdClass&$rowThe revision row for this line
string&$sThe string representing this parsed line
string[]&$classesArray containing the <li> element classes
array&$attribsAssociative array of other HTML attributes for the <li> element. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PageHistoryLineEndingHook.

Definition at line 2837 of file HookRunner.php.

◆ onPageHistoryPager__doBatchLookups()

MediaWiki\HookContainer\HookRunner::onPageHistoryPager__doBatchLookups ( $pager,
$result )

This hook is called after the pager query was run, before any output is generated, to allow batch lookups for prefetching information needed for display.

Since
1.35
Parameters
HistoryPager$pager
IResultWrapper$resultA ResultWrapper representing the query result
Returns
bool|void True or no return value to continue. False to skip the regular behavior of doBatchLookups().

Implements MediaWiki\Hook\PageHistoryPager__doBatchLookupsHook.

Definition at line 2846 of file HookRunner.php.

◆ onPageHistoryPager__getQueryInfo()

MediaWiki\HookContainer\HookRunner::onPageHistoryPager__getQueryInfo ( $pager,
& $queryInfo )

This hook is called when a history pager query parameter set is constructed.

Since
1.35
Parameters
HistoryPager$pager
array&$queryInfoThe query parameters
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PageHistoryPager__getQueryInfoHook.

Definition at line 2853 of file HookRunner.php.

◆ onPageMoveComplete()

MediaWiki\HookContainer\HookRunner::onPageMoveComplete ( $old,
$new,
$user,
$pageid,
$redirid,
$reason,
$revision )

This hook is called after moving an article (title), post-commit.

Since
1.35
Parameters
LinkTarget$oldOld title
LinkTarget$newNew title
UserIdentity$userUser who did the move
int$pageidDatabase ID of the page that's been moved
int$rediridDatabase ID of the created redirect
string$reasonReason for the move
RevisionRecord$revisionRevisionRecord created by the move
Returns
bool|void True or no return value to continue or false stop other hook handlers, doesn't abort the move itself

Implements MediaWiki\Hook\PageMoveCompleteHook.

Definition at line 2860 of file HookRunner.php.

◆ onPageMoveCompleting()

MediaWiki\HookContainer\HookRunner::onPageMoveCompleting ( $old,
$new,
$user,
$pageid,
$redirid,
$reason,
$revision )

This hook is called after moving an article (title), pre-commit.

Since
1.35
Parameters
LinkTarget$oldOld title
LinkTarget$newNew title
UserIdentity$userUser who did the move
int$pageidDatabase ID of the page that's been moved
int$rediridDatabase ID of the created redirect
string$reasonReason for the move
RevisionRecord$revisionRevisionRecord created by the move
Returns
bool|void True or no return value to continue or false stop other hook handlers, doesn't abort the move itself

Implements MediaWiki\Hook\PageMoveCompletingHook.

Definition at line 2867 of file HookRunner.php.

◆ onPageRenderingHash()

MediaWiki\HookContainer\HookRunner::onPageRenderingHash ( & $confstr,
$user,
& $forOptions )

NOTE: Consider using ParserOptionsRegister instead.

Use this hook to alter the parser cache option hash key. A parser extension which depends on user options should install this hook and append its values to the key.

Since
1.35
Parameters
string&$confstrReference to a hash key string which can be modified
User$userUser requesting the page
array&$forOptionsArray of options the hash is for
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PageRenderingHashHook.

Definition at line 2874 of file HookRunner.php.

◆ onPageSaveComplete()

MediaWiki\HookContainer\HookRunner::onPageSaveComplete ( $wikiPage,
$user,
$summary,
$flags,
$revisionRecord,
$editResult )

This hook is called after an article has been updated.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage modified
UserIdentity$userUser performing the modification
string$summaryEdit summary/comment
int$flagsFlags passed to WikiPage::doUserEditContent()
RevisionRecord$revisionRecordNew RevisionRecord of the article
EditResult$editResultObject storing information about the effects of this edit, including which edits were reverted and which edit is this based on (for reverts and null edits).
Returns
bool|void True or no return value to continue or false to stop other hook handlers from being called; save cannot be aborted

Implements MediaWiki\Storage\Hook\PageSaveCompleteHook.

Definition at line 2881 of file HookRunner.php.

◆ onPageUndelete()

MediaWiki\HookContainer\HookRunner::onPageUndelete ( ProperPageIdentity $page,
Authority $performer,
string $reason,
bool $unsuppress,
array $timestamps,
array $fileVersions,
StatusValue $status )

This hook is called before (part of) a page is undeleted.

Since
1.37
Parameters
ProperPageIdentity$pagePage being undeleted.
Authority$performerWho is undeleting the page
string$reasonReason the page is being undeleted
bool$unsuppressWhether content is being unsuppressed or not
string[]$timestampsTimestamps of revisions that we're going to undelete. If empty, means all revisions.
int[]$fileVersionsVersions of a file that we're going to undelete. If empty, means all versions.
StatusValue$statusAdd any error here.
Returns
bool|void True or no return value to continue; false to abort, which also requires adding a fatal error to $status.

Implements MediaWiki\Page\Hook\PageUndeleteHook.

Definition at line 2789 of file HookRunner.php.

◆ onPageUndeleteComplete()

MediaWiki\HookContainer\HookRunner::onPageUndeleteComplete ( ProperPageIdentity $page,
Authority $restorer,
string $reason,
RevisionRecord $restoredRev,
ManualLogEntry $logEntry,
int $restoredRevisionCount,
bool $created,
array $restoredPageIds )

This hook is called after a page is undeleted.

Since
1.40
Parameters
ProperPageIdentity$pagePage that was undeleted.
Authority$restorerWho undeleted the page
string$reasonReason the page was undeleted
RevisionRecord$restoredRevLast revision of the undeleted page
ManualLogEntry$logEntryLog entry generated by the restoration
int$restoredRevisionCountNumber of revisions restored during the deletion
bool$createdWhether the undeletion result in a page being created
array$restoredPageIdsArray of all undeleted page IDs. This will have multiple page IDs if there was more than one deleted page with the same page title.
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Page\Hook\PageUndeleteCompleteHook.

Definition at line 2804 of file HookRunner.php.

◆ onPageViewUpdates()

MediaWiki\HookContainer\HookRunner::onPageViewUpdates ( $wikipage,
$user )

Use this hook to make database (or other) changes after a page view is seen by MediaWiki.

Note this does not capture views made via external caches such as Squid.

Since
1.35
Parameters
WikiPage$wikipagePage being viewed
User$userUser who is viewing
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\PageViewUpdatesHook.

Definition at line 2890 of file HookRunner.php.

◆ onParserAfterParse()

MediaWiki\HookContainer\HookRunner::onParserAfterParse ( $parser,
& $text,
$stripState )

This hook is called from Parser::parse() just after the call to Parser::internalParse() returns.

Since
1.35
Parameters
Parser$parser
string&$textText being parsed
StripState$stripStateStripState used
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserAfterParseHook.

Definition at line 2897 of file HookRunner.php.

◆ onParserAfterTidy()

MediaWiki\HookContainer\HookRunner::onParserAfterTidy ( $parser,
& $text )

This hook is called after Parser::tidy() in Parser::parse().

Since
1.35
Parameters
Parser$parserParser being used
string&$textText that will be returned
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserAfterTidyHook.

Definition at line 2904 of file HookRunner.php.

◆ onParserBeforeInternalParse()

MediaWiki\HookContainer\HookRunner::onParserBeforeInternalParse ( $parser,
& $text,
$stripState )

This hook is called at the beginning of Parser::internalParse().

Since
1.35
Parameters
Parser$parser
string&$textText to parse
StripState$stripStateStripState instance being used
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserBeforeInternalParseHook.

Definition at line 2911 of file HookRunner.php.

◆ onParserBeforePreprocess()

MediaWiki\HookContainer\HookRunner::onParserBeforePreprocess ( $parser,
& $text,
$stripState )

Called at the beginning of Parser::preprocess()

Since
1.35
Parameters
Parser$parser
string&$texttext to parse
StripState$stripStateStripState instance being used
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserBeforePreprocessHook.

Definition at line 2918 of file HookRunner.php.

◆ onParserCacheSaveComplete()

MediaWiki\HookContainer\HookRunner::onParserCacheSaveComplete ( $parserCache,
$parserOutput,
$title,
$popts,
$revId )

This hook is called after a ParserOutput has been committed to the parser cache.

Since
1.35
Parameters
ParserCache$parserCacheParserCache object $parserOutput was stored in
ParserOutput$parserOutputParserOutput object that was stored
Title$titleTitle of the page that was parsed to generate $parserOutput
ParserOptions$poptsParserOptions used for generating $parserOutput
int$revIdID of the revision that was parsed to create $parserOutput
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserCacheSaveCompleteHook.

Definition at line 2925 of file HookRunner.php.

◆ onParserClearState()

MediaWiki\HookContainer\HookRunner::onParserClearState ( $parser)

This hook is called at the end of Parser::clearState().

Since
1.35
Parameters
Parser$parserParser object being cleared
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserClearStateHook.

Definition at line 2934 of file HookRunner.php.

◆ onParserCloned()

MediaWiki\HookContainer\HookRunner::onParserCloned ( $parser)

This hook is called when the parser is cloned.

Since
1.35
Parameters
Parser$parserNewly-cloned Parser object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserClonedHook.

Definition at line 2941 of file HookRunner.php.

◆ onParserFetchTemplateData()

MediaWiki\HookContainer\HookRunner::onParserFetchTemplateData ( array $titles,
array & $tplData )

This hook allows Parsoid to fetch additional serialization information about a Template, including the type of its arguments, whether they should be serialized as inline or block style wikitext, etc.

See [[Extension:TemplateData]] for more information.

Parameters
string[]$titlesAn array of template names
array<string,object>&$tplData The hook will create an associative array, mapping each given template name to an object representing the TemplateData for that template, or special objects if the title doesn't exist, is missing TemplateData, or has malformed TemplateData.
Returns
bool Typically returns true, to allow all registered hooks a chance to fill in template data.
Stability: unstable
temporary hook; will be cleaned up before it is made stable
Since
1.39

Implements MediaWiki\Hook\ParserFetchTemplateDataHook.

Definition at line 2948 of file HookRunner.php.

◆ onParserFirstCallInit()

MediaWiki\HookContainer\HookRunner::onParserFirstCallInit ( $parser)

This hook is called when the parser initialises for the first time.

Since
1.35
Parameters
Parser$parserParser object being initialised
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserFirstCallInitHook.

Definition at line 2955 of file HookRunner.php.

◆ onParserGetVariableValueSwitch()

MediaWiki\HookContainer\HookRunner::onParserGetVariableValueSwitch ( $parser,
& $variableCache,
$magicWordId,
& $ret,
$frame )

This hook is called when the parser needs the value of a custom magic word.

Since
1.35
Parameters
Parser$parser
array&$variableCacheArray to cache the value; when you return $variableCache[$magicWordId] should be the same as $ret
string$magicWordIdIndex of the magic word (hook should not mutate it!)
string&$retValue of the magic word (the hook should set it)
PPFrame$framePPFrame object to use for expanding any template variables
Returns
bool|void True or no return value to continue or false to abort
Note
Setting $variableCache[$magicWordId] is no longer necessary since MW 1.39, but hooks may wish to do so for backward compatibility.

Implements MediaWiki\Hook\ParserGetVariableValueSwitchHook.

Definition at line 2962 of file HookRunner.php.

◆ onParserGetVariableValueTs()

MediaWiki\HookContainer\HookRunner::onParserGetVariableValueTs ( $parser,
& $time )

Use this hook to change the value of the time for time-related magic words, ie {{CURRENTMONTH}}, {{LOCALMONTH}}, etc.

Since
1.35
Parameters
Parser$parser
string&$timeActual time (timestamp) in TS_UNIX format
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserGetVariableValueTsHook.

Definition at line 2971 of file HookRunner.php.

◆ onParserLimitReportFormat()

MediaWiki\HookContainer\HookRunner::onParserLimitReportFormat ( $key,
& $value,
& $report,
$isHTML,
$localize )

This hook is called for each row in the parser limit report that needs formatting.

If nothing handles this hook, the default is to use "$key" to get the label, and "$key-value" or "$key-value-text"/"$key-value-html" to format the value.

Since
1.35
Parameters
string$keyKey for the limit report item
string&$valueValue of the limit report item
string&$reportString onto which to append the data
bool$isHTMLIf true, $report is an HTML table with two columns; if false, it's text intended for display in a monospaced font
bool$localizeIf false, $report should be output in English
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserLimitReportFormatHook.

Definition at line 2978 of file HookRunner.php.

◆ onParserLimitReportPrepare()

MediaWiki\HookContainer\HookRunner::onParserLimitReportPrepare ( $parser,
$output )

This hook is called at the end of Parser:parse() when the parser will include comments about size of the text parsed.

Hooks should use $output->setLimitReportData() to populate data. Functions for this hook should not use $wgLang; do that in ParserLimitReportFormat instead.

Since
1.35
Parameters
Parser$parser
ParserOutput$output
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserLimitReportPrepareHook.

Definition at line 2987 of file HookRunner.php.

◆ onParserLogLinterData()

MediaWiki\HookContainer\HookRunner::onParserLogLinterData ( string $title,
int $revId,
array $lints )

This hook allows Parsoid to log additional linting information during a parse to a database maintained by the [[Extension:Linter]].

See [[Extension:Linter]] for more information.

Parameters
string$titleThe title of the page being parsed
int$revIdThe revision ID of the page being parsed (this hook is typically only invoked if this corresponds to the most recent revision of the given page).
array$lintsThe linter information for the given revision of the page.
Returns
bool Typically returns true, to allow all registered hooks a chance to record these lints.
Stability: unstable
temporary hook
Since
1.39

Implements MediaWiki\Hook\ParserLogLinterDataHook.

Definition at line 2994 of file HookRunner.php.

◆ onParserMakeImageParams()

MediaWiki\HookContainer\HookRunner::onParserMakeImageParams ( $title,
$file,
& $params,
$parser )

This hook is called before the parser generates an image link, use this to modify the parameters of the image.

Since
1.35
Parameters
Title$titleTitle object representing the file
File$fileFile object that will be used to create the image
array&$paramsTwo-dimensional array of parameters
Parser$parserParser object that called the hook
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserMakeImageParamsHook.

Definition at line 3001 of file HookRunner.php.

References $params.

◆ onParserModifyImageHTML()

MediaWiki\HookContainer\HookRunner::onParserModifyImageHTML ( Parser $parser,
File $file,
array $params,
string & $html )

This hook is called for each image added to parser output, with its associated HTML as returned from Linker::makeImageLink().

Parameters
Parser$parser
File$file
array$paramsAn associative array of options that were used to generate the HTML. Like the one sent to onParserMakeImageParams. The 'handler' element contains handler options. The 'frame' element contains frame options. In the image gallery case, "frame" will be missing.
string&$htmlThe HTML of the image or image wrapper

Implements MediaWiki\Hook\ParserModifyImageHTMLHook.

Definition at line 3008 of file HookRunner.php.

◆ onParserOptionsRegister()

MediaWiki\HookContainer\HookRunner::onParserOptionsRegister ( & $defaults,
& $inCacheKey,
& $lazyLoad )

Use this hook to register additional parser options.

Note that if you change the default value for an option, all existing parser cache entries will be invalid. To avoid bugs, you'll need to handle that somehow (e.g. with the RejectParserCacheValue hook) because MediaWiki won't do it for you.

Since
1.35
Parameters
array&$defaultsSet the default value for your option here
array&$inCacheKeyTo fragment the parser cache on your option, set a truthy value in this array, with the key being the option name.
array&$lazyLoadTo lazy-initialize your option, set it null in $defaults and set a callable in this array, with the key being the option name. The callable is passed the ParserOptions object and the option name.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserOptionsRegisterHook.

Definition at line 3018 of file HookRunner.php.

◆ onParserOutputPostCacheTransform()

MediaWiki\HookContainer\HookRunner::onParserOutputPostCacheTransform ( $parserOutput,
& $text,
& $options )

This hook is called from ParserOutput::getText() to do post-cache transforms.

Since
1.35
Parameters
ParserOutput$parserOutput
string&$textText being transformed, before core transformations are done
array&$optionsOptions array being used for the transformation
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Hook\ParserOutputPostCacheTransformHook.

Definition at line 3025 of file HookRunner.php.

◆ onParserOutputStashForEdit()

MediaWiki\HookContainer\HookRunner::onParserOutputStashForEdit ( $page,
$content,
$output,
$summary,
$user )

This hook is called when an edit stash parse finishes, before the output is cached.

Since
1.35
Parameters
WikiPage$pageWikiPage of the candidate edit
Content$contentContent object of the candidate edit
ParserOutput$outputParserOutput result of the candidate edit
string$summaryChange summary of the candidate edit
User$userUser considering the edit
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Storage\Hook\ParserOutputStashForEditHook.

Definition at line 3035 of file HookRunner.php.

◆ onParserPreSaveTransformComplete()

MediaWiki\HookContainer\HookRunner::onParserPreSaveTransformComplete ( $parser,
& $text )

This hook is called from Parser::preSaveTransform() after processing is complete, giving the extension a chance to further modify the wikitext.

Since
1.35
Parameters
Parser$parserCalling Parser instance
string&$textTransformed text, which can be modified by the hook
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserPreSaveTransformCompleteHook.

Definition at line 3044 of file HookRunner.php.

◆ onParserTestGlobals()

MediaWiki\HookContainer\HookRunner::onParserTestGlobals ( & $globals)

Use this hook to define globals for parser tests.

Since
1.35
Parameters
array&$globalsArray with all the globals which should be set for parser tests. The arrays keys serve as the globals' names, its values are the globals' values.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ParserTestGlobalsHook.

Definition at line 3051 of file HookRunner.php.

◆ onPasswordPoliciesForUser()

MediaWiki\HookContainer\HookRunner::onPasswordPoliciesForUser ( $user,
& $effectivePolicy )

Use this hook to alter the effective password policy for a user.

Since
1.35
Parameters
User$userUser whose policy you are modifying
array&$effectivePolicyArray of policy statements that apply to this user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PasswordPoliciesForUserHook.

Definition at line 3058 of file HookRunner.php.

◆ onPerformRetroactiveAutoblock()

MediaWiki\HookContainer\HookRunner::onPerformRetroactiveAutoblock ( $block,
& $blockIds )

This hook is called before a retroactive autoblock is applied to a user.

Since
1.35
Parameters
DatabaseBlock$blockBlock object which is set to be autoblocking
array&$blockIdsArray of block IDs of the autoblock
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Block\Hook\PerformRetroactiveAutoblockHook.

Definition at line 3065 of file HookRunner.php.

◆ onPermissionErrorAudit()

MediaWiki\HookContainer\HookRunner::onPermissionErrorAudit ( LinkTarget $title,
UserIdentity $user,
string $action,
string $rigor,
array $errors )

This hook is called from PermissionManager::getPermissionErrorsInternal() to collect internal permission errors and make them available to consumers.

Parameters
LinkTarget$titlePage in question
UserIdentity$userUser to check
string$actionAction being checked
string$rigorOne of PermissionManager::RIGOR_ constants
array[]$errorsArray of arrays of the arguments to wfMessage to explain permissions problems.
Returns
void This hook must not abort, it must return no value
Since
1.39

Implements MediaWiki\Permissions\Hook\PermissionErrorAuditHook.

Definition at line 1972 of file HookRunner.php.

◆ onPingLimiter()

MediaWiki\HookContainer\HookRunner::onPingLimiter ( $user,
$action,
& $result,
$incrBy )

Use this hook to override the results of User::pingLimiter().

Since
1.35
Parameters
User$userUser performing the action
string$actionAction being performed
bool&$resultWhether or not the action should be prevented Change $result and return false to give a definitive answer, otherwise the built-in rate limiting checks are used, if enabled.
int$incrByAmount to increment counter by
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\PingLimiterHook.

Definition at line 3072 of file HookRunner.php.

◆ onPlaceNewSection()

MediaWiki\HookContainer\HookRunner::onPlaceNewSection ( $content,
$oldtext,
$subject,
& $text )

Use this hook to override placement of new sections.

Since
1.35
Parameters
WikiPage | Content$contentFormerly a WikiPage, but accidentally a Content object since approximately 1.21
string$oldtextText of the article before editing
string$subjectSubject of the new section
string&$textText of the new section
Returns
bool|void True or no return value to continue, or false and put the merged text into $text to override the default behavior

Implements MediaWiki\Content\Hook\PlaceNewSectionHook.

Definition at line 3079 of file HookRunner.php.

◆ onPostLoginRedirect()

MediaWiki\HookContainer\HookRunner::onPostLoginRedirect ( & $returnTo,
& $returnToQuery,
& $type )

Use this hook to modify the post login redirect behavior.

Occurs after signing up or logging in, allows for interception of redirect.

Since
1.35
Parameters
string&$returnToThe page name to return to, as a string
string[]&$returnToQueryArray of url parameters, mapping parameter names to values
string&$typeType of login redirect as string:
  • error: display a return to link ignoring $wgRedirectOnLogin
  • signup: display a return to link using $wgRedirectOnLogin if needed
  • success: display a return to link using $wgRedirectOnLogin if needed
  • successredirect: send an HTTP redirect using $wgRedirectOnLogin if needed
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PostLoginRedirectHook.

Definition at line 3086 of file HookRunner.php.

◆ onPreferencesFormPreSave()

MediaWiki\HookContainer\HookRunner::onPreferencesFormPreSave ( $formData,
$form,
$user,
& $result,
$oldUserOptions )

Use this hook to override preferences being saved.

Since
1.35
Parameters
array$formDataArray of user submitted data
HTMLForm$formHTMLForm object, also a ContextSource
User$userUser with preferences to be saved
bool&$resultBoolean indicating success
array$oldUserOptionsArray with user's old options (before save)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Preferences\Hook\PreferencesFormPreSaveHook.

Definition at line 3093 of file HookRunner.php.

◆ onPreferencesGetIcon()

MediaWiki\HookContainer\HookRunner::onPreferencesGetIcon ( & $iconNames)

Use the hook to add an icon that will be displayed in the mobile layout of Special:Preferences.

Since
1.40
Parameters
array&$iconNamesa key-value array that assigns an icon name to a section name. The key is the section name, the value is the icon name. You can obtain the icon names from https://doc.wikimedia.org/oojs-ui/master/demos/?page=icons&theme=wikimediaui&direction=ltr&platform=desktop
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PreferencesGetIconHook.

Definition at line 3102 of file HookRunner.php.

◆ onPreferencesGetLayout()

MediaWiki\HookContainer\HookRunner::onPreferencesGetLayout ( & $useMobileLayout,
$skinName,
$skinProperties = [] )

Use the hook to check if the preferences will have a mobile or desktop layout.

Since
1.40
Parameters
bool&$useMobileLayouta boolean which will indicate whether to use a mobile layout or not
string$skinNamethe name of the skin being used
array$skinPropertiesan associative array that includes skin properties. A skin property could be one of the following:
  • isResponsive: Whether a skin can be responsive.
  • getVersion: Get the version of the skin. Is an empty array by default
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PreferencesGetLayoutHook.

Definition at line 3109 of file HookRunner.php.

◆ onPreferencesGetLegend()

MediaWiki\HookContainer\HookRunner::onPreferencesGetLegend ( $form,
$key,
& $legend )

Use the hook to override the text used for the <legend> of a preferences section.

Since
1.35
Parameters
HTMLForm$formthe HTMLForm object. This is a ContextSource as well
string$keythe section name
string&$legendthe legend text. Defaults to wfMessage( "prefs-$key" )->text() but may be overridden
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PreferencesGetLegendHook.

Definition at line 3118 of file HookRunner.php.

◆ onPrefixSearchBackend()

MediaWiki\HookContainer\HookRunner::onPrefixSearchBackend ( $ns,
$search,
$limit,
& $results,
$offset )

Use this hook to override the title prefix search used for OpenSearch and AJAX search suggestions.

Put results into &$results outparam and return false.

Since
1.35
Parameters
int[]$nsArray of int namespace keys to search in
string$searchSearch term (not guaranteed to be conveniently normalized)
int$limitMaximum number of results to return
string[]&$resultsOut param: array of page names
int$offsetNumber of results to offset from the beginning
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\PrefixSearchBackendHook.

Definition at line 3125 of file HookRunner.php.

◆ onPrefixSearchExtractNamespace()

MediaWiki\HookContainer\HookRunner::onPrefixSearchExtractNamespace ( & $namespaces,
& $search )

This hook is called if core was not able to extract a namespace from the search string so that extensions can attempt it.

Since
1.35
Parameters
int[]&$namespacesArray of int namespace keys to search in (change this if you can extract namespaces)
string&$searchSearch term (replace this with term without the namespace if you can extract one)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\PrefixSearchExtractNamespaceHook.

Definition at line 3134 of file HookRunner.php.

◆ onPrefsEmailAudit()

MediaWiki\HookContainer\HookRunner::onPrefsEmailAudit ( $user,
$oldaddr,
$newaddr )

This hook is called when user changes their email address.

Since
1.35
Parameters
User$userUser (object) changing his email address
string$oldaddrold email address (string)
string$newaddrnew email address (string)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\PrefsEmailAuditHook.

Definition at line 3141 of file HookRunner.php.

◆ onProtectionForm__buildForm()

MediaWiki\HookContainer\HookRunner::onProtectionForm__buildForm ( $article,
& $output )

This hook is called after all protection type fieldsets are made in the form.

Since
1.35
Parameters
Article$articleTitle being (un)protected
string&$outputString of the form HTML so far
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ProtectionForm__buildFormHook.

Definition at line 3148 of file HookRunner.php.

◆ onProtectionForm__save()

MediaWiki\HookContainer\HookRunner::onProtectionForm__save ( $article,
& $errorMsg,
$reasonstr )

This hook is called when a protection form is submitted.

Since
1.35
Parameters
Article$articlePage being (un)protected
string | array&$errorMsgHTML message string of an error or an array of message name and its parameters
string$reasonstrString describing the reason page protection level is altered
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ProtectionForm__saveHook.

Definition at line 3162 of file HookRunner.php.

◆ onProtectionForm__showLogExtract()

MediaWiki\HookContainer\HookRunner::onProtectionForm__showLogExtract ( $article,
$out )

This hook is called after the protection log extract is shown.

Since
1.35
Parameters
Article$articlePage the form is shown for
OutputPage$out
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ProtectionForm__showLogExtractHook.

Definition at line 3169 of file HookRunner.php.

◆ onProtectionFormAddFormFields()

MediaWiki\HookContainer\HookRunner::onProtectionFormAddFormFields ( $article,
& $hookFormOptions )

This hook is called after all protection type form fields are added.

Since
1.36
Parameters
Article$articleTitle being (un)protected
array&$hookFormOptionsAn array to add form fields to
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ProtectionFormAddFormFieldsHook.

Definition at line 3155 of file HookRunner.php.

◆ onRandomPageQuery()

MediaWiki\HookContainer\HookRunner::onRandomPageQuery ( & $tables,
& $conds,
& $joinConds )

Use this hook to modify the query used by Special:Random to select random pages.

Since
1.35
Parameters
array&$tablesDatabase tables to be used in the query
array&$condsConditions to be applied in the query
array&$joinCondsJoin conditions to be applied in the query
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\RandomPageQueryHook.

Definition at line 3176 of file HookRunner.php.

◆ onRawPageViewBeforeOutput()

MediaWiki\HookContainer\HookRunner::onRawPageViewBeforeOutput ( $obj,
& $text )

This hook is called right before the text is blown out in action=raw.

Since
1.35
Parameters
RawAction$obj
string&$textThe text that's going to be the output
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\RawPageViewBeforeOutputHook.

Definition at line 3183 of file HookRunner.php.

◆ onRecentChange_save()

MediaWiki\HookContainer\HookRunner::onRecentChange_save ( $recentChange)

This hook is called at the end of RecentChange::save().

Since
1.35
Parameters
RecentChange$recentChange
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\RecentChange_saveHook.

Definition at line 3197 of file HookRunner.php.

◆ onRecentChangesPurgeRows()

MediaWiki\HookContainer\HookRunner::onRecentChangesPurgeRows ( $rows)

This hook is called by RecentChangesUpdateJob when expired recentchanges rows are deleted, after deleting those rows but within the same database transaction.

Since
1.35
Parameters
\\stdClass[]$rowsDeleted rows as an array of recentchanges row objects (with up to $wgUpdateRowsPerQuery items)
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Hook\RecentChangesPurgeRowsHook.

Definition at line 3190 of file HookRunner.php.

◆ onRedirectSpecialArticleRedirectParams()

MediaWiki\HookContainer\HookRunner::onRedirectSpecialArticleRedirectParams ( & $redirectParams)

Use this hook to alter the set of parameter names such as "oldid" that are preserved when using redirecting special pages such as Special:MyPage and Special:MyTalk.

Since
1.35
Parameters
string[]&$redirectParamsArray of parameters preserved by redirecting special pages
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\RedirectSpecialArticleRedirectParamsHook.

Definition at line 3204 of file HookRunner.php.

◆ onRejectParserCacheValue()

MediaWiki\HookContainer\HookRunner::onRejectParserCacheValue ( $parserOutput,
$wikiPage,
$parserOptions )

Use this hook to reject an otherwise usable cached value from the Parser cache.

NOTE: CARELESS USE OF THIS HOOK CAN HAVE CATASTROPHIC CONSEQUENCES FOR HIGH-TRAFFIC INSTALLATIONS. USE WITH EXTREME CARE.

Since
1.35
Parameters
ParserOutput$parserOutputParserOutput value
WikiPage$wikiPage
ParserOptions$parserOptions
Returns
bool|void True or no return value to continue, or false to reject an otherwise usable cached value from the Parser cache

Implements MediaWiki\Hook\RejectParserCacheValueHook.

Definition at line 3211 of file HookRunner.php.

◆ onRenameUserAbort()

MediaWiki\HookContainer\HookRunner::onRenameUserAbort ( int $uid,
string $old,
string $new )

Allows the renaming to be aborted.

Parameters
int$uidThe user ID
string$oldThe old username
string$newThe new username
Returns
bool|void

Implements MediaWiki\RenameUser\Hook\RenameUserAbortHook.

Definition at line 3220 of file HookRunner.php.

◆ onRenameUserComplete()

MediaWiki\HookContainer\HookRunner::onRenameUserComplete ( int $uid,
string $old,
string $new )

Called after a user was renamed.

Parameters
int$uidThe user ID
string$oldThe old username
string$newThe new username

Implements MediaWiki\RenameUser\Hook\RenameUserCompleteHook.

Definition at line 3227 of file HookRunner.php.

◆ onRenameUserPreRename()

MediaWiki\HookContainer\HookRunner::onRenameUserPreRename ( int $uid,
string $old,
string $new )

Called before a user is renamed.

Parameters
int$uidThe user ID
string$oldThe old username
string$newThe new username

Implements MediaWiki\RenameUser\Hook\RenameUserPreRenameHook.

Definition at line 3235 of file HookRunner.php.

◆ onRenameUserSQL()

MediaWiki\HookContainer\HookRunner::onRenameUserSQL ( RenameuserSQL $renameUserSql)

Called in the constructer of RenameuserSQL (which performs the actual renaming of users).

Parameters
RenameuserSQL$renameUserSql

Implements MediaWiki\RenameUser\Hook\RenameUserSQLHook.

Definition at line 3243 of file HookRunner.php.

◆ onRenameUserWarning()

MediaWiki\HookContainer\HookRunner::onRenameUserWarning ( string $oldUsername,
string $newUsername,
array & $warnings )

Called on Special:Renameuser before a user is renamed.

Will show the given warnings to the user and ask for a confirmation.

Parameters
string$oldUsernameThe old username as a page title.
string$newUsernameThe new username as a page title.
array&$warningsAn array with 1 or more message keys, and 1 or more parameters for the warnings to be shown

Implements MediaWiki\RenameUser\Hook\RenameUserWarningHook.

Definition at line 3251 of file HookRunner.php.

◆ onRequestContextCreateSkin()

MediaWiki\HookContainer\HookRunner::onRequestContextCreateSkin ( $context,
& $skin )

This hook is called when RequestContext::getSkin creates a skin instance.

Use this hook to override what skin is used in certain contexts.

Since
1.35
Parameters
IContextSource$contextRequestContext the skin is being created for
null | string | Skin&$skinA variable reference you may modify to set a Skin instance or string key on to override the skin that will be used for the context.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\RequestContextCreateSkinHook.

Definition at line 3259 of file HookRunner.php.

◆ onResetPasswordExpiration()

MediaWiki\HookContainer\HookRunner::onResetPasswordExpiration ( $user,
& $newExpire )

Use this hook to allow extensions to set a default password expiration.

Since
1.35
Parameters
User$userUser having their password expiration reset
string&$newExpireNew expiration date
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Auth\Hook\ResetPasswordExpirationHook.

Definition at line 3266 of file HookRunner.php.

◆ onRevisionDataUpdates()

MediaWiki\HookContainer\HookRunner::onRevisionDataUpdates ( $title,
$renderedRevision,
& $updates )

This hook is called when constructing a list of DeferrableUpdate to be executed to record secondary data about a revision.

Since
1.35
Parameters
Title$titleTitle of the page the revision belongs to
RenderedRevision$renderedRevisionRenderedRevision object representing the new revision and providing access to the RevisionRecord as well as ParserOutput of that revision
DeferrableUpdate[]&$updatesList of DeferrableUpdate that can be manipulated by the hook handler
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Storage\Hook\RevisionDataUpdatesHook.

Definition at line 3273 of file HookRunner.php.

◆ onRevisionFromEditComplete()

MediaWiki\HookContainer\HookRunner::onRevisionFromEditComplete ( $wikiPage,
$rev,
$originalRevId,
$user,
& $tags )

This hook is called when a revision was inserted due to an edit, file upload, import or page move.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage edited
RevisionRecord$revNew revision
int | false$originalRevIdIf the edit restores or repeats an earlier revision (such as a rollback or a null revision), the ID of that earlier revision. False otherwise. (Used to be called $baseID.)
UserIdentity$userEditing user
string[]&$tagsTags to apply to the edit and recent change. This is empty, and replacement is ignored, in the case of import or page move.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\RevisionFromEditCompleteHook.

Definition at line 3280 of file HookRunner.php.

◆ onRevisionRecordInserted()

MediaWiki\HookContainer\HookRunner::onRevisionRecordInserted ( $revisionRecord)

This hook is called after a revision is inserted into the database.

Since
1.35
Parameters
RevisionRecord$revisionRecordRevisionRecord that has just been inserted
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Revision\Hook\RevisionRecordInsertedHook.

Definition at line 3287 of file HookRunner.php.

◆ onRevisionUndeleted()

MediaWiki\HookContainer\HookRunner::onRevisionUndeleted ( $revisionRecord,
$oldPageID )

After an article revision is restored.

Since
1.35
Parameters
RevisionRecord$revisionRecordthe RevisionRecord that was restored
?int$oldPageIDthe page ID of the revision when archived (may be null)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\RevisionUndeletedHook.

Definition at line 3294 of file HookRunner.php.

◆ onRollbackComplete()

MediaWiki\HookContainer\HookRunner::onRollbackComplete ( $wikiPage,
$user,
$revision,
$current )

After an article rollback is completed.

Since
1.35
Parameters
WikiPage$wikiPagethe WikiPage that was edited
UserIdentity$userUserIdentity for the user who did the rollback
RevisionRecord$revisionRevisionRecord for the revision the page was reverted back to
RevisionRecord$currentRevisionRecord for the reverted revision
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\RollbackCompleteHook.

Definition at line 3301 of file HookRunner.php.

◆ onSaveUserOptions()

MediaWiki\HookContainer\HookRunner::onSaveUserOptions ( UserIdentity $user,
array & $modifiedOptions,
array $originalOptions )

This hook is called just before saving user preferences.

Hook handlers can either add or manipulate options, or reset one back to its default to block changing it. Hook handlers are also allowed to abort the process by returning false, e.g. to save to a global profile instead. Compare to the UserSaveSettings hook, which is called after the preferences have been saved.

Since
1.37
Parameters
UserIdentity$userThe user for which the options are going to be saved
array&$modifiedOptionsThe user's options as an associative array, modifiable. To reset the preference value to default, set the preference to null. To block the preference from changing, unset the key from the array. To modify a preference value, set a new value.
array$originalOptionsThe user's original options being replaced
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Options\Hook\SaveUserOptionsHook.

Definition at line 4401 of file HookRunner.php.

◆ onSearchableNamespaces()

MediaWiki\HookContainer\HookRunner::onSearchableNamespaces ( & $arr)

Use this hook to modify which namespaces are searchable.

Since
1.35
Parameters
int[]&$arrArray of namespaces ($nsId => $name) which will be used
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchableNamespacesHook.

Definition at line 3308 of file HookRunner.php.

◆ onSearchAfterNoDirectMatch()

MediaWiki\HookContainer\HookRunner::onSearchAfterNoDirectMatch ( $term,
& $title )

This hook is called if there was no match for the exact result.

This runs before lettercase variants are attempted, whereas 'SearchGetNearMatch' runs after.

Since
1.35
Parameters
string$termSearch term
Title&$titleOutparam; set to $title object and return false for a match
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchAfterNoDirectMatchHook.

Definition at line 3315 of file HookRunner.php.

◆ onSearchDataForIndex()

MediaWiki\HookContainer\HookRunner::onSearchDataForIndex ( & $fields,
$handler,
$page,
$output,
$engine )

Use this hook to add data to search document.

Allows you to add any data to the field map used to index the document.

Since
1.35
Parameters
array&$fieldsArray of name => value pairs for fields
ContentHandler$handlerContentHandler for the content being indexed
WikiPage$pageWikiPage that is being indexed
ParserOutput$outputParserOutput that is produced from the page
SearchEngine$engineSearchEngine for which the indexing is intended
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Content\Hook\SearchDataForIndexHook.

Definition at line 3322 of file HookRunner.php.

◆ onSearchDataForIndex2()

MediaWiki\HookContainer\HookRunner::onSearchDataForIndex2 ( array & $fields,
\ContentHandler $handler,
\WikiPage $page,
ParserOutput $output,
\SearchEngine $engine,
RevisionRecord $revision )

Definition at line 3329 of file HookRunner.php.

◆ onSearchGetNearMatch()

MediaWiki\HookContainer\HookRunner::onSearchGetNearMatch ( $term,
& $title )

Use this hook to perform exact-title-matches in "go" searches if nothing was found.

Since
1.35
Parameters
string$termSearch term
Title&$titleOutparam; set to $title object and return false for a match
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchGetNearMatchHook.

Definition at line 3338 of file HookRunner.php.

◆ onSearchGetNearMatchBefore()

MediaWiki\HookContainer\HookRunner::onSearchGetNearMatchBefore ( $allSearchTerms,
& $titleResult )

Use this hook to perform exact-title-matches in "go" searches before the normal operations.

Since
1.35
Parameters
string[]$allSearchTermsArray of the search terms in all content languages
Title | null&$titleResultOutparam; the value to return
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchGetNearMatchBeforeHook.

Definition at line 3345 of file HookRunner.php.

◆ onSearchGetNearMatchComplete()

MediaWiki\HookContainer\HookRunner::onSearchGetNearMatchComplete ( $term,
& $title )

Use this hook to modify exact-title-matches in "go" searches.

Since
1.35
Parameters
string$termSearch term
Title | null&$titleCurrent Title object that is being returned (null if none found)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchGetNearMatchCompleteHook.

Definition at line 3352 of file HookRunner.php.

◆ onSearchIndexFields()

MediaWiki\HookContainer\HookRunner::onSearchIndexFields ( & $fields,
$engine )

Use this hook to add fields to search index mapping.

Since
1.35
Parameters
SearchIndexField[]&$fieldsArray of fields, all implement SearchIndexField
SearchEngine$engineSearchEngine instance for which mapping is being built
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchIndexFieldsHook.

Definition at line 3359 of file HookRunner.php.

◆ onSearchResultInitFromTitle()

MediaWiki\HookContainer\HookRunner::onSearchResultInitFromTitle ( $title,
& $id )

Use this hook to set the revision used when displaying a page in search results.

Since
1.35
Parameters
Title$titleCurrent title being displayed in search results
int | bool&$idRevision ID (default is false, for latest)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchResultInitFromTitleHook.

Definition at line 3366 of file HookRunner.php.

◆ onSearchResultProvideDescription()

MediaWiki\HookContainer\HookRunner::onSearchResultProvideDescription ( array $pageIdentities,
& $descriptions )

This hook is called when generating search results in order to fill the 'description' field in an extension.

Since
1.35
Parameters
array$pageIdentitiesArray (string=>SearchResultPageIdentity) where key is pageId
array&$descriptionsOutput array (string=>string|null) where key is pageId and value is either a description for given page or null

Implements MediaWiki\Rest\Hook\SearchResultProvideDescriptionHook.

Definition at line 3373 of file HookRunner.php.

◆ onSearchResultProvideThumbnail()

MediaWiki\HookContainer\HookRunner::onSearchResultProvideThumbnail ( array $pageIdentities,
& $thumbnails,
int $size = null )

This hook is called when generating search results in order to fill the 'thumbnail' field in an extension.

Since
1.35
Parameters
array$pageIdentitiesArray (string=>PageIdentity) where key is pageId
array&$thumbnailsOutput array (string=>SearchResultThumbnail|null) where key is pageId and value is either a valid SearchResultThumbnail for given page or null
int | null$sizesize of thumbnail height and width in points

Implements MediaWiki\Search\Hook\SearchResultProvideThumbnailHook.

Definition at line 3380 of file HookRunner.php.

◆ onSearchResultsAugment()

MediaWiki\HookContainer\HookRunner::onSearchResultsAugment ( & $setAugmentors,
& $rowAugmentors )

Use this hook to add code to the list of search result augmentors.

Since
1.35
Parameters
ResultSetAugmentor[]&$setAugmentorsList of whole-set augmentor objects, must implement ResultSetAugmentor
ResultAugmentor[]&$rowAugmentorsList of per-row augmentor objects, must implement ResultAugmentor. Note that lists should be in the format name => object and the names in both lists should be distinct.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SearchResultsAugmentHook.

Definition at line 3387 of file HookRunner.php.

◆ onSecuritySensitiveOperationStatus()

MediaWiki\HookContainer\HookRunner::onSecuritySensitiveOperationStatus ( & $status,
$operation,
$session,
$timeSinceAuth )

Use this hook to affect the return value from MediaWiki\Auth\AuthManager::securitySensitiveOperationStatus().

Since
1.35
Parameters
string&$statusStatus to be returned. One of the AuthManager::SEC_* constants. SEC_REAUTH will be automatically changed to SEC_FAIL if authentication isn't possible for the current session type.
string$operationOperation being checked
Session$sessionCurrent session. The currently-authenticated user may be retrieved as $session->getUser().
int$timeSinceAuthTime since last authentication. PHP_INT_MAX if the time of last auth is unknown, or -1 if authentication is not possible.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Auth\Hook\SecuritySensitiveOperationStatusHook.

Definition at line 3394 of file HookRunner.php.

◆ onSelfLinkBegin()

MediaWiki\HookContainer\HookRunner::onSelfLinkBegin ( $nt,
& $html,
& $trail,
& $prefix,
& $ret )

This hook is called before a link to the current article is displayed to allow the display of the link to be customized.

Since
1.35
Parameters
Title$nt
string&$htmlHTML to display for the link
string&$trailOptional text to display before $html
string&$prefixOptional text to display after $html
string&$retValue to return if your hook returns false
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SelfLinkBeginHook.

Definition at line 3403 of file HookRunner.php.

◆ onSendWatchlistEmailNotification()

MediaWiki\HookContainer\HookRunner::onSendWatchlistEmailNotification ( $targetUser,
$title,
$enotif )

Use this hook to cancel watchlist email notifications (enotifwatchlist) for an edit.

Since
1.35
Parameters
User$targetUserUser whom to send watchlist email notification
Title$titlePage title
EmailNotification$enotif
Returns
bool|void True or no return value to send watchlist email notification, or false to abort

Implements MediaWiki\Hook\SendWatchlistEmailNotificationHook.

Definition at line 3410 of file HookRunner.php.

◆ onSessionCheckInfo()

MediaWiki\HookContainer\HookRunner::onSessionCheckInfo ( & $reason,
$info,
$request,
$metadata,
$data )

Use this hook to validate a MediaWiki\Session\SessionInfo as it's being loaded from storage.

Since
1.35
Parameters
string&$reasonRejection reason to be logged
SessionInfo$infoMediaWiki\Session\SessionInfo being validated
WebRequest$requestWebRequest being loaded from
array | bool$metadataMetadata array for the MediaWiki\Session\Session
array | bool$dataData array for the MediaWiki\Session\Session
Returns
bool|void True or no return value to continue, or false to prevent the MediaWiki\Session\SessionInfo from being used

Implements MediaWiki\Session\Hook\SessionCheckInfoHook.

Definition at line 3417 of file HookRunner.php.

◆ onSessionMetadata()

MediaWiki\HookContainer\HookRunner::onSessionMetadata ( $backend,
& $metadata,
$requests )

Use this hook to add metadata to a session being saved.

Since
1.35
Parameters
SessionBackend$backendMediaWiki\Session\SessionBackend being saved
array&$metadataMetadata to be stored. Add new keys here.
WebRequest[]$requestsArray of WebRequests potentially being saved to. Generally 0-1 real request and 0+ FauxRequests.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Session\Hook\SessionMetadataHook.

Definition at line 3426 of file HookRunner.php.

◆ onSetupAfterCache()

MediaWiki\HookContainer\HookRunner::onSetupAfterCache ( )

This hook is called in Setup.php, after cache objects are set.

Since
1.35
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SetupAfterCacheHook.

Definition at line 3433 of file HookRunner.php.

◆ onShortPagesQuery()

MediaWiki\HookContainer\HookRunner::onShortPagesQuery ( & $tables,
& $conds,
& $joinConds,
& $options )

Use this hook to modify the query used by Special:ShortPages.

Since
1.35
Parameters
array&$tablestables to join in the query
array&$condsconditions for the query
array&$joinCondsjoin conditions for the query
array&$optionsoptions for the query
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ShortPagesQueryHook.

Definition at line 3440 of file HookRunner.php.

◆ onShowMissingArticle()

MediaWiki\HookContainer\HookRunner::onShowMissingArticle ( $article)

This hook is called when generating the output for a non-existent page.

Since
1.35
Parameters
Article$articleArticle corresponding to the page
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\ShowMissingArticleHook.

Definition at line 3447 of file HookRunner.php.

◆ onShowSearchHit()

MediaWiki\HookContainer\HookRunner::onShowSearchHit ( $searchPage,
$result,
$terms,
& $link,
& $redirect,
& $section,
& $extract,
& $score,
& $size,
& $date,
& $related,
& $html )

Use this hook to customize display of search hit.

Since
1.35
Parameters
SpecialSearch$searchPage
SearchResult$resultSearchResult to show
string[]$termsSearch terms, for highlighting (unreliable as search engine dependent)
string&$linkHTML of link to the matching page. May be modified.
string&$redirectHTML of redirect info. May be modified.
string&$sectionHTML of matching section. May be modified.
string&$extractHTML of content extract. May be modified.
string&$scoreHTML of score. May be modified.
string&$sizeHTML of page size. May be modified.
string&$dateHTML of page modification date. May be modified.
string&$relatedHTML of additional info for the matching page. May be modified.
string&$htmlMay be set to the full HTML that should be used to represent the search hit. Must include the <li> ... </li> tags. Will only be used if the hook function returned false.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\ShowSearchHitHook.

Definition at line 3454 of file HookRunner.php.

◆ onShowSearchHitTitle()

MediaWiki\HookContainer\HookRunner::onShowSearchHitTitle ( & $title,
& $titleSnippet,
$result,
$terms,
$specialSearch,
& $query,
& $attributes )

Use this hook to customise display of search hit title/link.

Since
1.35
Parameters
Title&$titleTitle to link to
string | HtmlArmor | null&$titleSnippetLabel for the link representing the search result. Typically the article title.
SearchResult$result
array$termsArray of search terms extracted by SearchDatabase search engines (may not be populated by other search engines)
SpecialSearch$specialSearch
string[]&$queryArray of query string parameters for the link representing the search result
string[]&$attributesArray of title link attributes, can be modified by extension
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\ShowSearchHitTitleHook.

Definition at line 3464 of file HookRunner.php.

◆ onSidebarBeforeOutput()

MediaWiki\HookContainer\HookRunner::onSidebarBeforeOutput ( $skin,
& $sidebar )

Use this hook to edit the sidebar just before it is output by skins.

Warning: This hook is run on each display. You should consider using 'SkinBuildSidebar', which is aggressively cached.

Since
1.35
Parameters
Skin$skin
array&$sidebarSidebar content. Modify $sidebar to add or modify sidebar portlets.
Returns
void This hook must not abort; it must not return value.

Implements MediaWiki\Hook\SidebarBeforeOutputHook.

Definition at line 3474 of file HookRunner.php.

◆ onSiteNoticeAfter()

MediaWiki\HookContainer\HookRunner::onSiteNoticeAfter ( & $siteNotice,
$skin )

This hook is called after the sitenotice/anonnotice is composed.

Since
1.35
Parameters
string&$siteNoticeHTML sitenotice. Alter the contents of $siteNotice to add to/alter the sitenotice/anonnotice.
Skin$skin
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SiteNoticeAfterHook.

Definition at line 3482 of file HookRunner.php.

◆ onSiteNoticeBefore()

MediaWiki\HookContainer\HookRunner::onSiteNoticeBefore ( & $siteNotice,
$skin )

This hook is called before the sitenotice/anonnotice is composed.

Since
1.35
Parameters
string&$siteNoticeHTML returned as the sitenotice
Skin$skin
Returns
bool|void True or no return value to continue or false to abort. Return true to allow the normal method of notice selection/rendering to work, or change the value of $siteNotice and return false to alter it.

Implements MediaWiki\Hook\SiteNoticeBeforeHook.

Definition at line 3489 of file HookRunner.php.

◆ onSkinAddFooterLinks()

MediaWiki\HookContainer\HookRunner::onSkinAddFooterLinks ( Skin $skin,
string $key,
array & $footerItems )

This hook is called when generating the code used to display the footer.

Since
1.35
Parameters
Skin$skin
string$keythe current key for the current group (row) of footer links. e.g. info or places.
array&$footerItemsan empty array that can be populated with new links. keys should be strings and will be used for generating the ID of the footer item and value should be an HTML string.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinAddFooterLinksHook.

Definition at line 3506 of file HookRunner.php.

◆ onSkinAfterBottomScripts()

MediaWiki\HookContainer\HookRunner::onSkinAfterBottomScripts ( $skin,
& $text )

This hook is called in OutputPage::getBottomScripts() and allows to add extra html at the end of bottom scripts section.

Since
1.35
Parameters
Skin$skin
string&$textBottomScripts text. Append to $text to add additional text/scripts after the stock bottom scripts.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinAfterBottomScriptsHook.

Definition at line 3513 of file HookRunner.php.

◆ onSkinAfterContent()

MediaWiki\HookContainer\HookRunner::onSkinAfterContent ( & $data,
$skin )

Use this hook to add text after the page content and article metadata.

This hook should work in all skins. Set the &$data variable to the text you're going to add.

Since
1.35
Parameters
string&$dataText to be printed out directly (without parsing)
Skin$skin
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinAfterContentHook.

Definition at line 3520 of file HookRunner.php.

◆ onSkinAfterPortlet()

MediaWiki\HookContainer\HookRunner::onSkinAfterPortlet ( $skin,
$portletName,
& $html )

This hook is called when generating portlets.

It allows injecting custom HTML after the portlet.

Since
1.35
Parameters
Skin$skin
string$portletName
string&$html
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Skins\Hook\SkinAfterPortletHook.

Definition at line 3527 of file HookRunner.php.

◆ onSkinBuildSidebar()

MediaWiki\HookContainer\HookRunner::onSkinBuildSidebar ( $skin,
& $bar )

This hook is called at the end of Skin::buildSidebar().

Since
1.35
Parameters
Skin$skin
array&$barSidebar contents. Modify $bar to add or modify sidebar portlets.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinBuildSidebarHook.

Definition at line 3534 of file HookRunner.php.

◆ onSkinCopyrightFooter()

MediaWiki\HookContainer\HookRunner::onSkinCopyrightFooter ( $title,
$type,
& $msg,
& $link )

Use this hook for site and per-namespace customization of the copyright notice.

Since
1.35
Parameters
Title$titleDisplayed page title
string$typeSet to 'normal' or 'history' for old/diff views
string&$msgOverridable message, usually 'copyright' or 'history_copyright'. This message must be in HTML format, not wikitext!
string&$linkOverridable HTML link to be passed into the message as $1
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinCopyrightFooterHook.

Definition at line 3541 of file HookRunner.php.

◆ onSkinEditSectionLinks()

MediaWiki\HookContainer\HookRunner::onSkinEditSectionLinks ( $skin,
$title,
$section,
$sectionTitle,
& $result,
$lang )

Use this hook to modify section edit links.

Since
1.35
Parameters
Skin$skinSkin object rendering the UI
Title$titleTitle being linked to (may not be the same as the page title, if the section is included from a template)
string$sectionDesignation of the section being pointed to, to be included in the link, like "&section=$section"
string$sectionTitleSection title, used in the default tooltip. Escape before using. By default, this is wrapped in the 'editsectionhint' message.
array&$resultArray containing all link detail arrays. Each link detail array should contain the following keys:
  • targetTitle: Target Title object
  • text: String for the text
  • attribs: Array of attributes
  • query: Array of query parameters to add to the URL
Language$langLanguage to use for the link in the wfMessage function
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinEditSectionLinksHook.

Definition at line 3548 of file HookRunner.php.

◆ onSkinPageReadyConfig()

MediaWiki\HookContainer\HookRunner::onSkinPageReadyConfig ( RL\Context $context,
array & $config )

Allows skins to change the mediawiki.page.ready module configuration.

Since
1.36
Parameters
RL\\Context$context
mixed[]&$configAssociative array of configurable options
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Skins\Hook\SkinPageReadyConfigHook.

Definition at line 3496 of file HookRunner.php.

◆ onSkinPreloadExistence()

MediaWiki\HookContainer\HookRunner::onSkinPreloadExistence ( & $titles,
$skin )

Use this hook to supply titles that should be added to link existence cache before the page is rendered.

Since
1.35
Parameters
Title[]&$titles
Skin$skin
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinPreloadExistenceHook.

Definition at line 3557 of file HookRunner.php.

◆ onSkinSubPageSubtitle()

MediaWiki\HookContainer\HookRunner::onSkinSubPageSubtitle ( & $subpages,
$skin,
$out )

This hook is called at the beginning of Skin::subPageSubtitle().

Since
1.35
Parameters
string&$subpagesSubpage links HTML
Skin$skin
OutputPage$out
Returns
bool|void True or no return value to continue or false to abort. If true is returned, $subpages will be ignored and the rest of subPageSubtitle() will run. If false is returned, $subpages will be used instead of the HTML subPageSubtitle() generates.

Implements MediaWiki\Hook\SkinSubPageSubtitleHook.

Definition at line 3564 of file HookRunner.php.

◆ onSkinTemplateGetLanguageLink()

MediaWiki\HookContainer\HookRunner::onSkinTemplateGetLanguageLink ( & $languageLink,
$languageLinkTitle,
$title,
$outputPage )

This hook is called after building the data for a language link from which the actual html is constructed.

Since
1.35
Parameters
array&$languageLinkArray containing data about the link. The following keys can be modified: href, text, title, class, lang, hreflang. Each of them is a string.
Title$languageLinkTitleTitle object belonging to the external language link
Title$titleTitle object of the page the link belongs to
OutputPage$outputPageOutputPage object the links are built from
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SkinTemplateGetLanguageLinkHook.

Definition at line 3571 of file HookRunner.php.

◆ onSkinTemplateNavigation__Universal()

MediaWiki\HookContainer\HookRunner::onSkinTemplateNavigation__Universal ( $sktemplate,
& $links )

This hook is called on both content and special pages after variants have been added.

Since
1.35
Parameters
SkinTemplate$sktemplate
array&$linksStructured navigation links. This is used to alter the navigation for skins which use buildNavigationUrls such as Vector.
Returns
void This hook must not abort, it must return no value

Implements MediaWiki\Hook\SkinTemplateNavigation__UniversalHook.

Definition at line 3580 of file HookRunner.php.

◆ onSoftwareInfo()

MediaWiki\HookContainer\HookRunner::onSoftwareInfo ( & $software)

This hook is called by Special:Version for returning information about the software.

Since
1.35
Parameters
array&$softwareThe array of software in format 'name' => 'version'. See SpecialVersion::softwareInformation().
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SoftwareInfoHook.

Definition at line 3588 of file HookRunner.php.

◆ onSpecialBlockModifyFormFields()

MediaWiki\HookContainer\HookRunner::onSpecialBlockModifyFormFields ( $sp,
& $fields )

Use this hook to add more fields to Special:Block.

Since
1.35
Parameters
SpecialBlock$spSpecialPage object, for context
array&$fieldsCurrent HTMLForm fields
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialBlockModifyFormFieldsHook.

Definition at line 3595 of file HookRunner.php.

◆ onSpecialContributions__formatRow__flags()

MediaWiki\HookContainer\HookRunner::onSpecialContributions__formatRow__flags ( $context,
$row,
& $flags )

This hook is called before rendering a Special:Contributions row.

Since
1.35
Parameters
IContextSource$context
stdClass$rowRevision information from the database
string[]&$flagsHTML fragments describing flags for this row
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialContributions__formatRow__flagsHook.

Definition at line 3609 of file HookRunner.php.

◆ onSpecialContributions__getForm__filters()

MediaWiki\HookContainer\HookRunner::onSpecialContributions__getForm__filters ( $sp,
& $filters )

This hook is called with a list of filters to render on Special:Contributions.

Since
1.35
Parameters
SpecialContributions$spSpecialContributions object, for context
array&$filtersList of filter object definitions (compatible with OOUI form)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialContributions__getForm__filtersHook.

Definition at line 3618 of file HookRunner.php.

◆ onSpecialContributionsBeforeMainOutput()

MediaWiki\HookContainer\HookRunner::onSpecialContributionsBeforeMainOutput ( $id,
$user,
$sp )

This hook is called before the form on Special:Contributions.

Since
1.35
Parameters
int$idUser id number, only provided for backwards-compatibility
User$userUser object representing user contributions are being fetched for
SpecialContributions$spSpecialPage instance, providing context
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialContributionsBeforeMainOutputHook.

Definition at line 3602 of file HookRunner.php.

◆ onSpecialCreateAccountBenefits()

MediaWiki\HookContainer\HookRunner::onSpecialCreateAccountBenefits ( ?string & $html,
array $info,
array & $options )

Replace the default signup page content about the benefits of registering an account ("Wikipedia is made by people like you...") on Special:CreateAccount.

Parameters
string | null&$htmlHTML to use instead of the default .mw-createacct-benefits-container block. By default, this is null, which means the default content will be used.
array$infoArray of information:
  • context: (IContextSource) Context object.
  • form: (HTMLForm) The signup form. Read-only - the form HTML has already been generated.
array&$optionsArray of modifiable options:
  • beforeForm: (bool, default false) Whether to insert the HTML before the form. This is mainly useful on mobile (where the login form might push the benefits out of view; but also, a long benefits block might push the form out of view).
Returns
bool|void True or no return value to continue or false to abort.
Since
1.40

Implements MediaWiki\Hook\SpecialCreateAccountBenefitsHook.

Definition at line 3625 of file HookRunner.php.

◆ onSpecialExportGetExtraPages()

MediaWiki\HookContainer\HookRunner::onSpecialExportGetExtraPages ( $inputPages,
& $extraPages )

Definition at line 3632 of file HookRunner.php.

◆ onSpecialListusersDefaultQuery()

MediaWiki\HookContainer\HookRunner::onSpecialListusersDefaultQuery ( $pager,
& $query )

This hook is called right before the end of UsersPager::getDefaultQuery().

Since
1.35
Parameters
UsersPager$pagerThe UsersPager instance
array&$queryThe query array to be returned
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialListusersDefaultQueryHook.

Definition at line 3639 of file HookRunner.php.

◆ onSpecialListusersFormatRow()

MediaWiki\HookContainer\HookRunner::onSpecialListusersFormatRow ( & $item,
$row )

This hook is called right before the end of UsersPager::formatRow().

Since
1.35
Parameters
string&$itemHTML to be returned. Will be wrapped in an after the hook finishes
stdClass$rowDatabase row object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialListusersFormatRowHook.

Definition at line 3646 of file HookRunner.php.

◆ onSpecialListusersHeader()

MediaWiki\HookContainer\HookRunner::onSpecialListusersHeader ( $pager,
& $out )

This hook is called after adding the submit button in UsersPager::getPageHeader().

Since
1.35
Parameters
UsersPager$pagerThe UsersPager instance
string&$outThe header HTML
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialListusersHeaderHook.

Definition at line 3653 of file HookRunner.php.

◆ onSpecialListusersHeaderForm()

MediaWiki\HookContainer\HookRunner::onSpecialListusersHeaderForm ( $pager,
& $out )

This hook is called before adding the submit button in UsersPager::getPageHeader().

Since
1.35
Parameters
UsersPager$pagerThe UsersPager instance
string&$outThe header HTML
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialListusersHeaderFormHook.

Definition at line 3660 of file HookRunner.php.

◆ onSpecialListusersQueryInfo()

MediaWiki\HookContainer\HookRunner::onSpecialListusersQueryInfo ( $pager,
& $query )

This hook is called right before the end of UsersPager::getQueryInfo()

Since
1.35
Parameters
UsersPager$pagerThe UsersPager instance
array&$queryThe query array to be returned
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialListusersQueryInfoHook.

Definition at line 3667 of file HookRunner.php.

◆ onSpecialLogAddLogSearchRelations()

MediaWiki\HookContainer\HookRunner::onSpecialLogAddLogSearchRelations ( $type,
$request,
& $qc )

Use this hook to add log relations to the current log.

Since
1.35
Parameters
string$typeString of the log type
WebRequest$requestWebRequest object for getting the value provided by the current user
array&$qcArray for query conditions to add
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialLogAddLogSearchRelationsHook.

Definition at line 3674 of file HookRunner.php.

◆ onSpecialMovepageAfterMove()

MediaWiki\HookContainer\HookRunner::onSpecialMovepageAfterMove ( $movePage,
$oldTitle,
$newTitle )

This hook is called after moving a page.

Since
1.35
Parameters
SpecialMovePage$movePage
Title$oldTitle
Title$newTitle
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialMovepageAfterMoveHook.

Definition at line 3681 of file HookRunner.php.

◆ onSpecialMuteModifyFormFields()

MediaWiki\HookContainer\HookRunner::onSpecialMuteModifyFormFields ( $target,
$user,
& $fields )

Use this hook to add more fields to Special:Mute.

Since
1.35
Parameters
User | null$targetTarget user
User$userContext user
array&$fieldsCurrent HTMLForm fields descriptors
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialMuteModifyFormFieldsHook.

Definition at line 3688 of file HookRunner.php.

◆ onSpecialNewpagesConditions()

MediaWiki\HookContainer\HookRunner::onSpecialNewpagesConditions ( $special,
$opts,
& $conds,
& $tables,
& $fields,
& $join_conds )

This hook is called when building the SQL query for Special:NewPages.

Since
1.35
Parameters
NewPagesPager$specialNewPagesPager object (subclass of ReverseChronologicalPager)
FormOptions$optsFormOptions object containing special page options
array&$condsarray of WHERE conditionals for query
array&$tablesarray of tables to be queried
array&$fieldsarray of columns to select
array&$join_condsjoin conditions for the tables
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialNewpagesConditionsHook.

Definition at line 3695 of file HookRunner.php.

◆ onSpecialNewPagesFilters()

MediaWiki\HookContainer\HookRunner::onSpecialNewPagesFilters ( $special,
& $filters )

This hook is called after building form options at NewPages.

Since
1.35
Parameters
SpecialNewPages$specialThe special page object
array&$filtersAssociative array of filter definitions. The keys are the HTML name/URL parameters. Each key maps to an associative array with a 'msg' (message key) and a 'default' value.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialNewPagesFiltersHook.

Definition at line 3704 of file HookRunner.php.

◆ onSpecialPage_initList()

MediaWiki\HookContainer\HookRunner::onSpecialPage_initList ( & $list)

This hook is called when setting up SpecialPageFactory::$list.

Use this hook to remove a core special page or conditionally register special pages.

Note
The existence of a special page must not depend on the request context (e.g. current user or current title). Possible red/blue links from wiki pages are cached in the parser cache and must be stable across the requests from different users or for different pages. Use only site config or checks if extensions are loaded to add or remove special pages from the list. Override SpecialPage::userCanExecute or set a user right when calling SpecialPage::__construct, after registering the special page for all users, to restrict the access for users allowed to use the page. When replacing a (core) special page in the list, it is possible to depend on the request context, but this hook is also called from Setup and the the user is not always safe to load, call User::isSafeToLoad before using any User class function or one of the user services like UserOptionsLookup/UserOptionsManager. Also the title may not be set for all requests (for e.g. api.php or load.php), so checks for title should be avoided.
Since
1.35
Parameters
array&$listList of core special pages, mapping of (canonical) page name to class name, factory callback or to ObjectFactory spec
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\SpecialPage_initListHook.

Definition at line 3732 of file HookRunner.php.

◆ onSpecialPageAfterExecute()

MediaWiki\HookContainer\HookRunner::onSpecialPageAfterExecute ( $special,
$subPage )

This hook is called after SpecialPage::execute.

Since
1.35
Parameters
SpecialPage$special
string | null$subPageSubpage string, or null if no subpage was specified
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\SpecialPageAfterExecuteHook.

Definition at line 3711 of file HookRunner.php.

◆ onSpecialPageBeforeExecute()

MediaWiki\HookContainer\HookRunner::onSpecialPageBeforeExecute ( $special,
$subPage )

This hook is called before SpecialPage::execute.

Since
1.35
Parameters
SpecialPage$special
string | null$subPageSubpage string, or null if no subpage was specified
Returns
bool|void True or no return value to continue or false to prevent execution

Implements MediaWiki\SpecialPage\Hook\SpecialPageBeforeExecuteHook.

Definition at line 3718 of file HookRunner.php.

◆ onSpecialPageBeforeFormDisplay()

MediaWiki\HookContainer\HookRunner::onSpecialPageBeforeFormDisplay ( $name,
$form )

This hook is called before executing the HTMLForm object.

Since
1.35
Parameters
string$nameName of the special page
HTMLForm$form
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\SpecialPageBeforeFormDisplayHook.

Definition at line 3725 of file HookRunner.php.

◆ onSpecialPasswordResetOnSubmit()

MediaWiki\HookContainer\HookRunner::onSpecialPasswordResetOnSubmit ( & $users,
$data,
& $error )

This hook is called when executing a form submission on Special:PasswordReset.

Since
1.35
Parameters
User[]&$users
array$dataArray of data submitted by the user
string | array | MessageSpecifier&$errorString, error code (message key) used to describe to error (out parameter). The hook needs to return false when setting this, otherwise it will have no effect.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\SpecialPasswordResetOnSubmitHook.

Definition at line 3739 of file HookRunner.php.

◆ onSpecialPrefixIndexGetFormFilters()

MediaWiki\HookContainer\HookRunner::onSpecialPrefixIndexGetFormFilters ( IContextSource $contextSource,
array & $filters )

This hook is called with a list of filters to render on Special:PrefixIndex.

Since
1.42
Parameters
IContextSource$contextSource
array&$filtersList of filter object definitions (compatible with OOUI form)
Returns
void Un-abortable hook

Implements MediaWiki\Hook\SpecialPrefixIndexGetFormFiltersHook.

Definition at line 3746 of file HookRunner.php.

◆ onSpecialPrefixIndexQuery()

MediaWiki\HookContainer\HookRunner::onSpecialPrefixIndexQuery ( array $fieldData,
SelectQueryBuilder $queryBuilder )

Use this hook to modify the query used by Special:PrefixIndex.

Since
1.42
Parameters
array$fieldData
SelectQueryBuilder$queryBuilderQuery builder for altering the query being run
Returns
void Un-abortable hook

Implements MediaWiki\Hook\SpecialPrefixIndexQueryHook.

Definition at line 3754 of file HookRunner.php.

◆ onSpecialRandomGetRandomTitle()

MediaWiki\HookContainer\HookRunner::onSpecialRandomGetRandomTitle ( & $randstr,
& $isRedir,
& $namespaces,
& $extra,
& $title )

This hook is called during the execution of Special:Random,.

Use this to change some selection criteria or substitute a different title.

Since
1.35
Parameters
string&$randstrThe random number from wfRandom()
bool&$isRedirBoolean, whether to select a redirect or non-redirect
int[]&$namespacesAn array of namespace indexes to get the title from
array&$extraAn array of extra SQL statements
Title&$titleIf the hook returns false, a Title object to use instead of the result from the normal query
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialRandomGetRandomTitleHook.

Definition at line 3762 of file HookRunner.php.

◆ onSpecialRecentChangesPanel()

MediaWiki\HookContainer\HookRunner::onSpecialRecentChangesPanel ( & $extraOpts,
$opts )

This hook is called when building form options in SpecialRecentChanges.

Since
1.35
Parameters
array&$extraOptsArray of added items, to which can be added
FormOptions$optsFormOptions for this request
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialRecentChangesPanelHook.

Definition at line 3771 of file HookRunner.php.

◆ onSpecialResetTokensTokens()

MediaWiki\HookContainer\HookRunner::onSpecialResetTokensTokens ( & $tokens)

This hook is called when building token list for SpecialResetTokens.

Since
1.35
Parameters
array&$tokensarray of token information arrays in the format of [ 'preference' => '<preference-name>', 'label-message' => '<message-key>', ]
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialResetTokensTokensHook.

Definition at line 3778 of file HookRunner.php.

◆ onSpecialSearchCreateLink()

MediaWiki\HookContainer\HookRunner::onSpecialSearchCreateLink ( $t,
& $params )

This hook is called when making the message to create a page or go to the existing page.

Since
1.35
Parameters
Title$tTitle object searched for
array&$paramsAn array of the default message name and page title (as parameter)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchCreateLinkHook.

Definition at line 3785 of file HookRunner.php.

References $params.

◆ onSpecialSearchGoResult()

MediaWiki\HookContainer\HookRunner::onSpecialSearchGoResult ( $term,
$title,
& $url )

Use this hook to alter the behaviour of the 'go' feature when searching.

If a hook returns false the 'go' feature will be canceled and a normal search will be performed. Returning true without setting $url does a standard redirect to $title. Setting $url redirects to the specified URL.

Since
1.35
Parameters
string$termThe string the user searched for
Title$titleThe title the 'go' feature has decided to forward the user to
string | null&$urlInitially null, hook subscribers can set this to specify the final url to redirect to
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchGoResultHook.

Definition at line 3792 of file HookRunner.php.

◆ onSpecialSearchNogomatch()

MediaWiki\HookContainer\HookRunner::onSpecialSearchNogomatch ( & $title)

This hook is called when the 'Go' feature is triggered and the target doesn't exist.

This generally comes from autocomplete search other than the main bar on Special:Search. Full text search results are generated after this hook is called.

Since
1.35
Parameters
Title&$titleTitle object generated from the text entered by the user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchNogomatchHook.

Definition at line 3799 of file HookRunner.php.

◆ onSpecialSearchPowerBox()

MediaWiki\HookContainer\HookRunner::onSpecialSearchPowerBox ( & $showSections,
$term,
& $opts )

Use this hook to modify advanced search profile forms.

This hook is equivalent to SpecialSearchProfileForm for the advanced form, also know as power search box.

Since
1.35
Parameters
string[]&$showSectionsArray to add values with more options to
string$termSearch term (not a title object)
string[]&$optsArray of hidden options (containing 'redirs' and 'profile')
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SpecialSearchPowerBoxHook.

Definition at line 3806 of file HookRunner.php.

◆ onSpecialSearchProfileForm()

MediaWiki\HookContainer\HookRunner::onSpecialSearchProfileForm ( $search,
& $form,
$profile,
$term,
$opts )

Use this hook to modify search profile forms.

Since
1.35
Parameters
SpecialPage$search
string&$formForm HTML
string$profileCurrent search profile
string$termSearch term
string[]$optsKey => value of hidden options for inclusion in custom forms
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Search\Hook\SpecialSearchProfileFormHook.

Definition at line 3813 of file HookRunner.php.

◆ onSpecialSearchProfiles()

MediaWiki\HookContainer\HookRunner::onSpecialSearchProfiles ( & $profiles)

Use this hook to modify search profiles.

Since
1.35
Parameters
array&$profilesprofiles, which can be modified.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchProfilesHook.

Definition at line 3822 of file HookRunner.php.

◆ onSpecialSearchResults()

MediaWiki\HookContainer\HookRunner::onSpecialSearchResults ( $term,
& $titleMatches,
& $textMatches )

This hook is called before search result display.

Since
1.35
Parameters
string$termSearch term
?ISearchResultSet&$titleMatchesEmpty or ISearchResultSet object
?ISearchResultSet&$textMatchesEmpty or ISearchResultSet object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchResultsHook.

Definition at line 3829 of file HookRunner.php.

◆ onSpecialSearchResultsAppend()

MediaWiki\HookContainer\HookRunner::onSpecialSearchResultsAppend ( $specialSearch,
$output,
$term )

This hook is called immediately before returning HTML on the search results page.

Useful for including a feedback link.

Since
1.35
Parameters
SpecialSearch$specialSearchSpecialSearch object ($this)
OutputPage$output$wgOut
string$termSearch term specified by the user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchResultsAppendHook.

Definition at line 3836 of file HookRunner.php.

◆ onSpecialSearchResultsPrepend()

MediaWiki\HookContainer\HookRunner::onSpecialSearchResultsPrepend ( $specialSearch,
$output,
$term )

This hook is called immediately before returning HTML on the search results page.

Useful for including an external search provider. To disable the output of MediaWiki search output, return false.

Since
1.35
Parameters
SpecialSearch$specialSearchSpecialSearch object ($this)
OutputPage$output$wgOut
string$termSearch term specified by the user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchResultsPrependHook.

Definition at line 3843 of file HookRunner.php.

◆ onSpecialSearchSetupEngine()

MediaWiki\HookContainer\HookRunner::onSpecialSearchSetupEngine ( $search,
$profile,
$engine )

Use this hook for passing custom data to the search engine.

Since
1.35
Parameters
SpecialSearch$search
string$profileCurrent search profile
SearchEngine$engine
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialSearchSetupEngineHook.

Definition at line 3850 of file HookRunner.php.

◆ onSpecialStatsAddExtra()

MediaWiki\HookContainer\HookRunner::onSpecialStatsAddExtra ( & $extraStats,
$context )

Use this hook to add extra statistics at the end of Special:Statistics.

Since
1.35
Parameters
array&$extraStatsArray to save the new stats $extraStats['<name of statistic>'] =>

;

can be an array with the keys "name" and "number": "name" is the HTML to be displayed in the name column "number" is the number to be displayed. or,

can be the number to be displayed and <name> is the message key to use in the name column,

Parameters
IContextSource$context
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialStatsAddExtraHook.

Definition at line 3857 of file HookRunner.php.

◆ onSpecialTrackingCategories__generateCatLink()

MediaWiki\HookContainer\HookRunner::onSpecialTrackingCategories__generateCatLink ( $specialPage,
$catTitle,
& $html )

This hook is called for each category link on Special:TrackingCategories.

Since
1.35
Parameters
SpecialTrackingCategories$specialPage
LinkTarget$catTitleThe LinkTarget object of the linked category
string&$htmlThe Result html
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialTrackingCategories__generateCatLinkHook.

Definition at line 3864 of file HookRunner.php.

◆ onSpecialTrackingCategories__preprocess()

MediaWiki\HookContainer\HookRunner::onSpecialTrackingCategories__preprocess ( $specialPage,
$trackingCategories )

This hook is called after LinkBatch on Special:TrackingCategories.

Since
1.35
Parameters
SpecialTrackingCategories$specialPage
array$trackingCategoriesArray of data from Special:TrackingCategories with msg and cats
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialTrackingCategories__preprocessHook.

Definition at line 3873 of file HookRunner.php.

◆ onSpecialUploadComplete()

MediaWiki\HookContainer\HookRunner::onSpecialUploadComplete ( $form)

This hook is called after successfully uploading a file from Special:Upload.

Since
1.35
Parameters
SpecialUpload$form
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialUploadCompleteHook.

Definition at line 3882 of file HookRunner.php.

◆ onSpecialVersionVersionUrl()

MediaWiki\HookContainer\HookRunner::onSpecialVersionVersionUrl ( $version,
& $versionUrl )

This hook is called when building the URL for Special:Version.

Since
1.35
Parameters
string$versionCurrent MediaWiki version
string&$versionUrlRaw url to link to (eg: release notes)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialVersionVersionUrlHook.

Definition at line 3889 of file HookRunner.php.

◆ onSpecialWatchlistGetNonRevisionTypes()

MediaWiki\HookContainer\HookRunner::onSpecialWatchlistGetNonRevisionTypes ( & $nonRevisionTypes)

This hook is called when building the SQL query for SpecialWatchlist.

It allows extensions to register custom values they have inserted to rc_type so they can be returned as part of the watchlist.

Since
1.35
Parameters
int[]&$nonRevisionTypesArray of values in the rc_type field of the recentchanges table
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\SpecialWatchlistGetNonRevisionTypesHook.

Definition at line 3896 of file HookRunner.php.

◆ onTempUserCreatedRedirect()

MediaWiki\HookContainer\HookRunner::onTempUserCreatedRedirect ( Session $session,
UserIdentity $user,
string $returnTo,
string $returnToQuery,
string $returnToAnchor,
& $redirectUrl )

This hook is called after an action causes a temporary user to be created.

The handler may modify the redirect URL.

Since
1.39
Parameters
Session$session
UserIdentity$user
string$returnToThe prefixed DB key of the title to redirect to
string$returnToQueryAn extra query part
string$returnToAnchorEither an empty string or a fragment beginning with "#"
string&$redirectUrlThe URL to redirect to
Returns
bool|null

Implements MediaWiki\Hook\TempUserCreatedRedirectHook.

Definition at line 3903 of file HookRunner.php.

◆ onTestCanonicalRedirect()

MediaWiki\HookContainer\HookRunner::onTestCanonicalRedirect ( $request,
$title,
$output )

This hook is called when about to force a redirect to a canonical URL for a title when we have no other parameters on the URL.

Use this hook to alter page view behavior radically to abort that redirect or handle it manually.

Since
1.35
Parameters
WebRequest$request
Title$titleTitle of the currently found Title object
OutputPage$output
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TestCanonicalRedirectHook.

Definition at line 3917 of file HookRunner.php.

◆ onTextSlotDiffRendererTablePrefix()

MediaWiki\HookContainer\HookRunner::onTextSlotDiffRendererTablePrefix ( \TextSlotDiffRenderer $textSlotDiffRenderer,
IContextSource $context,
array & $parts )

Definition at line 1331 of file HookRunner.php.

◆ onThumbnailBeforeProduceHTML()

MediaWiki\HookContainer\HookRunner::onThumbnailBeforeProduceHTML ( $thumbnail,
& $attribs,
& $linkAttribs )

This hook is called before an image HTML is about to be rendered (by ThumbnailImage:toHtml method).

Since
1.35
Parameters
ThumbnailImage$thumbnail
string[]&$attribsImage attribute array
string[]&$linkAttribsImage link attribute array
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\ThumbnailBeforeProduceHTMLHook.

Definition at line 3924 of file HookRunner.php.

◆ onTitleExists()

MediaWiki\HookContainer\HookRunner::onTitleExists ( $title,
& $exists )

This hook is called when determining whether a page exists at a given title.

Since
1.35
Parameters
Title$titleTitle being tested
bool&$existsWhether the title exists
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TitleExistsHook.

Definition at line 3933 of file HookRunner.php.

◆ onTitleGetEditNotices()

MediaWiki\HookContainer\HookRunner::onTitleGetEditNotices ( $title,
$oldid,
& $notices )

Use this hook to add edit notices.

Since
1.35
Parameters
Title$titleTitle object for the page the edit notices are for
int$oldidRevision ID that the edit notices are for (or 0 for latest)
array&$noticesArray of notices. Keys are i18n message keys, values are parseAsBlock()ed messages.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TitleGetEditNoticesHook.

Definition at line 3940 of file HookRunner.php.

◆ onTitleGetRestrictionTypes()

MediaWiki\HookContainer\HookRunner::onTitleGetRestrictionTypes ( $title,
& $types )

Use this hook to modify the types of protection that can be applied.

Since
1.35
Parameters
Title$titleTitle in question
string[]&$typesTypes of protection available
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TitleGetRestrictionTypesHook.

Definition at line 3947 of file HookRunner.php.

◆ onTitleIsAlwaysKnown()

MediaWiki\HookContainer\HookRunner::onTitleIsAlwaysKnown ( $title,
& $isKnown )

This hook is called when determining if a page exists.

Use this hook to override default behavior for determining if a page exists. If $isKnown is kept as null, regular checks happen. If it's a boolean, this value is returned by the isKnown method.

Since
1.35
Parameters
Title$titleTitle object that is being checked
bool | null&$isKnownWhether MediaWiki currently thinks this page is known
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TitleIsAlwaysKnownHook.

Definition at line 3954 of file HookRunner.php.

◆ onTitleIsMovable()

MediaWiki\HookContainer\HookRunner::onTitleIsMovable ( $title,
& $result )

This hook is called when determining if it is possible to move a page.

Note that this hook is not called for interwiki pages or pages in immovable namespaces: for these, isMovable() always returns false.

Since
1.35
Parameters
Title$titleTitle object that is being checked
bool&$resultWhether MediaWiki currently thinks this page is movable. Hooks may change this value to override the return value of Title::isMovable().
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TitleIsMovableHook.

Definition at line 3961 of file HookRunner.php.

◆ onTitleMove()

MediaWiki\HookContainer\HookRunner::onTitleMove ( $old,
$nt,
$user,
$reason,
& $status )

Definition at line 3968 of file HookRunner.php.

◆ onTitleMoveStarting()

MediaWiki\HookContainer\HookRunner::onTitleMoveStarting ( $old,
$nt,
$user )

This hook is called before moving an article (title), but just after the atomic DB section starts.

Since
1.35
Parameters
Title$oldOld title
Title$ntNew title
User$userUser who does the move
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TitleMoveStartingHook.

Definition at line 3975 of file HookRunner.php.

◆ onTitleQuickPermissions()

MediaWiki\HookContainer\HookRunner::onTitleQuickPermissions ( $title,
$user,
$action,
& $errors,
$doExpensiveQueries,
$short )

This hook is called from Title::checkQuickPermissions to add to or override the quick permissions check.

Since
1.35
Parameters
Title$titleTitle being accessed
User$userUser performing the action
string$actionAction being performed
array&$errorsArray of errors
bool$doExpensiveQueriesWhether to do expensive database queries
bool$shortWhether to return immediately on first error
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\TitleQuickPermissionsHook.

Definition at line 3982 of file HookRunner.php.

◆ onTitleReadWhitelist()

MediaWiki\HookContainer\HookRunner::onTitleReadWhitelist ( $title,
$user,
& $whitelisted )

This hook is called at the end of read permissions checks, just before adding the default error message if nothing allows the user to read the page.

Since
1.35
Parameters
Title$titleTitle being checked against
User$userCurrent user
bool&$whitelistedWhether this title is whitelisted
Returns
bool|void True or no return value to continue, or false to not whitelist the title

Implements MediaWiki\Permissions\Hook\TitleReadWhitelistHook.

Definition at line 3991 of file HookRunner.php.

◆ onTitleSquidURLs()

MediaWiki\HookContainer\HookRunner::onTitleSquidURLs ( $title,
& $urls )

This hook is called to determine which URLs to purge from HTTP caches.

Since
1.35
Parameters
Title$titleTitle object to purge
string[]&$urlsArray of URLs to purge from the caches, to be manipulated
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\TitleSquidURLsHook.

Definition at line 3998 of file HookRunner.php.

◆ onUnblockUser()

MediaWiki\HookContainer\HookRunner::onUnblockUser ( $block,
$user,
& $reason )

This hook is called before an IP address or user is unblocked.

Since
1.35
Parameters
DatabaseBlock$blockThe Block object about to be saved
User$userThe user performing the unblock (not the one being unblocked)
array&$reasonIf the hook is aborted, the error message to be returned in an array
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UnblockUserHook.

Definition at line 4005 of file HookRunner.php.

◆ onUnblockUserComplete()

MediaWiki\HookContainer\HookRunner::onUnblockUserComplete ( $block,
$user )

This hook is called after an IP address or user has been unblocked.

Since
1.35
Parameters
DatabaseBlock$blockThe Block object that was saved
User$userThe user who performed the unblock (not the one being unblocked)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UnblockUserCompleteHook.

Definition at line 4012 of file HookRunner.php.

◆ onUndeleteForm__showHistory()

MediaWiki\HookContainer\HookRunner::onUndeleteForm__showHistory ( & $archive,
$title )

This hook is called in UndeleteForm::showHistory, after creating the PageArchive object.

Since
1.35
Parameters
PageArchive&$archivePageArchive object
Title$titleTitle object of the page that we're viewing
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UndeleteForm__showHistoryHook.

Definition at line 4019 of file HookRunner.php.

◆ onUndeleteForm__showRevision()

MediaWiki\HookContainer\HookRunner::onUndeleteForm__showRevision ( & $archive,
$title )

This hook is called in UndeleteForm::showRevision, after creating a PageArchive object.

Since
1.35
Parameters
PageArchive&$archivePageArchive object
Title$titleTitle object of the page that we're viewing
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UndeleteForm__showRevisionHook.

Definition at line 4026 of file HookRunner.php.

◆ onUndeletePageToolLinks()

MediaWiki\HookContainer\HookRunner::onUndeletePageToolLinks ( IContextSource $context,
LinkRenderer $linkRenderer,
array & $links )

Use this hook to add one or more links to edit page subtitle when a page has been previously deleted.

Since
1.35
Parameters
IContextSource$context
LinkRenderer$linkRenderer
string[]&$linksArray of HTML strings
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UndeletePageToolLinksHook.

Definition at line 4033 of file HookRunner.php.

◆ onUnitTestsAfterDatabaseSetup()

MediaWiki\HookContainer\HookRunner::onUnitTestsAfterDatabaseSetup ( $database,
$prefix )

This hook is called right after MediaWiki's test infrastructure has finished creating/duplicating core tables for unit tests.

Since
1.35
Parameters
IMaintainableDatabase$databaseDatabase in question
string$prefixTable prefix to be used in unit tests
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UnitTestsAfterDatabaseSetupHook.

Definition at line 4040 of file HookRunner.php.

◆ onUnitTestsBeforeDatabaseTeardown()

MediaWiki\HookContainer\HookRunner::onUnitTestsBeforeDatabaseTeardown ( )

This hook is called right before MediaWiki tears down its database infrastructure used for unit tests.

Since
1.35
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UnitTestsBeforeDatabaseTeardownHook.

Definition at line 4047 of file HookRunner.php.

◆ onUnitTestsList()

MediaWiki\HookContainer\HookRunner::onUnitTestsList ( & $paths)

This hook is called when building a list of paths containing PHPUnit tests.

Since 1.24, paths pointing to a directory will be recursively scanned for test case files matching the suffix "Test.php".

Since
1.35
Parameters
array&$pathsList of test cases and directories to search
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UnitTestsListHook.

Definition at line 4054 of file HookRunner.php.

◆ onUnwatchArticle()

MediaWiki\HookContainer\HookRunner::onUnwatchArticle ( $user,
$page,
& $status )

This hook is called before a watch is removed from an article.

Since
1.35
Parameters
User$userUser watching
WikiPage$pageWikiPage object to be removed
Status&$statusStatus object to be returned if the hook returns false
Returns
bool|void True or no return value to continue or false to abort and return Status object

Implements MediaWiki\Hook\UnwatchArticleHook.

Definition at line 4061 of file HookRunner.php.

◆ onUnwatchArticleComplete()

MediaWiki\HookContainer\HookRunner::onUnwatchArticleComplete ( $user,
$page )

This hook is called after a watch is removed from an article.

Since
1.35
Parameters
User$userUser that watched
WikiPage$pageWikiPage object that was watched
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UnwatchArticleCompleteHook.

Definition at line 4068 of file HookRunner.php.

◆ onUpdateUserMailerFormattedPageStatus()

MediaWiki\HookContainer\HookRunner::onUpdateUserMailerFormattedPageStatus ( & $formattedPageStatus)

This hook is called before a notification email gets sent.

Since
1.35
Parameters
string[]&$formattedPageStatusList of valid page states
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UpdateUserMailerFormattedPageStatusHook.

Definition at line 4075 of file HookRunner.php.

◆ onUploadComplete()

MediaWiki\HookContainer\HookRunner::onUploadComplete ( $uploadBase)

This hook is called upon completion of a file upload.

Since
1.35
Parameters
UploadBase$uploadBaseUploadBase (or subclass) object. File can be accessed by $uploadBase->getLocalFile().
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadCompleteHook.

Definition at line 4082 of file HookRunner.php.

◆ onUploadCreateFromRequest()

MediaWiki\HookContainer\HookRunner::onUploadCreateFromRequest ( $type,
& $className )

This hook is called when UploadBase::createFromRequest has been called.

Since
1.35
Parameters
string$typeRequested upload type
string&$classNameClass name of the Upload instance to be created
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadCreateFromRequestHook.

Definition at line 4089 of file HookRunner.php.

◆ onUploadForm_BeforeProcessing()

MediaWiki\HookContainer\HookRunner::onUploadForm_BeforeProcessing ( $upload)

This hook is called at the beginning of processUpload().

Lets you poke at member variables like $mUploadDescription before the file is saved. Do not use this hook to break upload processing. This will return the user to a blank form with no error message; use UploadVerifyUpload or UploadVerifyFile instead.

Since
1.35
Parameters
SpecialUpload$upload
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadForm_BeforeProcessingHook.

Definition at line 4112 of file HookRunner.php.

◆ onUploadForm_getInitialPageText()

MediaWiki\HookContainer\HookRunner::onUploadForm_getInitialPageText ( & $pageText,
$msg,
$config )

This hook is called after the initial page text for file uploads is generated.

It allows extensions to modify the initial page text.

Since
1.35
Parameters
string&$pageText
string[]$msgArray of header messages
Config$config
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadForm_getInitialPageTextHook.

Definition at line 4119 of file HookRunner.php.

◆ onUploadForm_initial()

MediaWiki\HookContainer\HookRunner::onUploadForm_initial ( $upload)

This hook is called before the upload form is generated.

Extensions might set the member-variables $uploadFormTextTop and $uploadFormTextAfterSummary to inject text (HTML) either before or after the editform.

Since
1.35
Parameters
SpecialUpload$upload
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadForm_initialHook.

Definition at line 4126 of file HookRunner.php.

◆ onUploadFormInitDescriptor()

MediaWiki\HookContainer\HookRunner::onUploadFormInitDescriptor ( & $descriptor)

This hook is called after the descriptor for the upload form as been assembled.

Since
1.35
Parameters
array&$descriptor(array) the HTMLForm descriptor
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadFormInitDescriptorHook.

Definition at line 4096 of file HookRunner.php.

◆ onUploadFormSourceDescriptors()

MediaWiki\HookContainer\HookRunner::onUploadFormSourceDescriptors ( & $descriptor,
& $radio,
$selectedSourceType )

This hook is called after the standard source inputs have been added to the descriptor.

Since
1.35
Parameters
array&$descriptorThe HTMLForm descriptor
bool&$radioBoolean, if source type should be shown as radio button
string$selectedSourceType
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadFormSourceDescriptorsHook.

Definition at line 4103 of file HookRunner.php.

◆ onUploadStashFile()

MediaWiki\HookContainer\HookRunner::onUploadStashFile ( $upload,
$user,
$props,
& $error )

Definition at line 4133 of file HookRunner.php.

◆ onUploadVerifyFile()

MediaWiki\HookContainer\HookRunner::onUploadVerifyFile ( $upload,
$mime,
& $error )

Use this hook to perform extra file verification, based on MIME type, etc.

Since
1.35
Parameters
UploadBase$uploadInstance of UploadBase, with all info about the upload
string$mimeUploaded file's MIME type, as detected by MediaWiki. Handlers will typically only apply for specific MIME types.
bool | array | MessageSpecifier&$errorOutput: true if the file is valid. Otherwise, set this to the reason in the form of [ messagename, param1, param2, ... ] or a MessageSpecifier instance. (You might want to use ApiMessage to provide machine -readable details for the API.)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UploadVerifyFileHook.

Definition at line 4140 of file HookRunner.php.

◆ onUploadVerifyUpload()

MediaWiki\HookContainer\HookRunner::onUploadVerifyUpload ( $upload,
$user,
$props,
$comment,
$pageText,
& $error )

Definition at line 4147 of file HookRunner.php.

◆ onUser__mailPasswordInternal()

MediaWiki\HookContainer\HookRunner::onUser__mailPasswordInternal ( $user,
$ip,
$u )

This hook is called before creation and mailing of a user's new temporary password.

Since
1.35
Parameters
User$userThe user who sent the message out
string$ipIP of the user who sent the message out
User$uThe account whose new password will be set
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\User__mailPasswordInternalHook.

Definition at line 4450 of file HookRunner.php.

◆ onUserAddGroup()

MediaWiki\HookContainer\HookRunner::onUserAddGroup ( $user,
& $group,
& $expiry )

This hook is called when adding a group or changing a group's expiry.

Since
1.35
Parameters
User$userThe user that is to have a group added
string&$groupThe group to add; can be modified
string | null&$expiryThe expiry time in TS_MW format, or null if the group is not to expire; can be modified
Returns
bool|void True or no return value to continue or false to abort (not add the group)

Implements MediaWiki\User\Hook\UserAddGroupHook.

Definition at line 4156 of file HookRunner.php.

◆ onUserArrayFromResult()

MediaWiki\HookContainer\HookRunner::onUserArrayFromResult ( & $userArray,
$res )

This hook is called when creating an UserArray object from a database result.

Since
1.35
Parameters
UserArrayFromResult | null&$userArraySet this to an object to override the default
IResultWrapper$resDatabase result used to create the object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserArrayFromResultHook.

Definition at line 4163 of file HookRunner.php.

◆ onUserCan()

MediaWiki\HookContainer\HookRunner::onUserCan ( $title,
$user,
$action,
& $result )

Use this hook to interrupt or advise the "user can do X to Y article" check.

If you want to display an error message, try getUserPermissionsErrors.

Since
1.35
Parameters
Title$titleTitle being checked against
User$userCurrent user
string$actionAction being checked
string&$resultPointer to result returned if hook returns false. If null is returned, userCan checks are continued by internal code.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\UserCanHook.

Definition at line 4170 of file HookRunner.php.

◆ onUserCanSendEmail()

MediaWiki\HookContainer\HookRunner::onUserCanSendEmail ( $user,
& $hookErr )

Use this hook to override User::canSendEmail() permission check.

Since
1.35
Parameters
User$userUser (object) whose permission is being checked
bool | string | array&$hookErrOut-param for the error. Passed as the parameters to OutputPage::showErrorPage.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserCanSendEmailHook.

Definition at line 4177 of file HookRunner.php.

◆ onUserClearNewTalkNotification()

MediaWiki\HookContainer\HookRunner::onUserClearNewTalkNotification ( $userIdentity,
$oldid )

This hook is called post-send when viewing a user talk page.

The hook may be aborted, in which case the TalkPageNotificationManager service will not clear the "You have new messages!" notification, and if the page is on the viewer's watchlist then WatchlistManager will also not update the "seen" marker.

See also
\MediaWiki\Users watchlist handling\WatchlistManager::clearTitleUserNotifications
Since
1.35
Parameters
UserIdentity$userIdentityUser that will clear the message
int$oldidRevision ID of the talk page being viewed (0 means the most recent one)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserClearNewTalkNotificationHook.

Definition at line 4184 of file HookRunner.php.

◆ onUserEditCountUpdate()

MediaWiki\HookContainer\HookRunner::onUserEditCountUpdate ( $infos)

This is called from a deferred update on edit or move and provides collected user edit count information.

Parameters
UserEditCountInfo[]$infos
Returns
void

Implements MediaWiki\Hook\UserEditCountUpdateHook.

Definition at line 4191 of file HookRunner.php.

◆ onUserEffectiveGroups()

MediaWiki\HookContainer\HookRunner::onUserEffectiveGroups ( $user,
& $groups )

This hook is called in UserGroupManager::getUserEffectiveGroups().

Since
1.35
Parameters
User$userUser to get groups for
string[]&$groupsCurrent effective groups
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserEffectiveGroupsHook.

Definition at line 4199 of file HookRunner.php.

◆ onUserGetAllRights()

MediaWiki\HookContainer\HookRunner::onUserGetAllRights ( & $rights)

This hook is called after calculating a list of all available rights.

Since
1.35
Parameters
string[]&$rightsArray of rights, which may be added to
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\UserGetAllRightsHook.

Definition at line 4206 of file HookRunner.php.

◆ onUserGetDefaultOptions()

MediaWiki\HookContainer\HookRunner::onUserGetDefaultOptions ( & $defaultOptions)

This hook is called after fetching core default user options but before returning the options.

Warning: This hook is called for every call to UserOptionsLookup::getDefaultOptions(), which means it's potentially called dozens or hundreds of times. You may want to cache the results of non-trivial operations in your hook function for this reason.

Since
1.35
Parameters
array&$defaultOptionsArray of preference keys and their default values.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserGetDefaultOptionsHook.

Definition at line 4213 of file HookRunner.php.

◆ onUserGetEmail()

MediaWiki\HookContainer\HookRunner::onUserGetEmail ( $user,
& $email )

This hook is called when getting an user email address.

Since
1.35
Parameters
User$user
string&$emailEmail, change this to override local email
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserGetEmailHook.

Definition at line 4220 of file HookRunner.php.

◆ onUserGetEmailAuthenticationTimestamp()

MediaWiki\HookContainer\HookRunner::onUserGetEmailAuthenticationTimestamp ( $user,
& $timestamp )

This hook is called when getting the timestamp of email authentication.

Since
1.35
Parameters
User$user
string&$timestampTimestamp. Change this to override the local email authentication timestamp.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserGetEmailAuthenticationTimestampHook.

Definition at line 4227 of file HookRunner.php.

◆ onUserGetLanguageObject()

MediaWiki\HookContainer\HookRunner::onUserGetLanguageObject ( $user,
& $code,
$context )

This hook is called when getting a user's interface language object.

Since
1.35
Parameters
User$user
string&$codeLanguage code that will be used to create the object
IContextSource$context
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UserGetLanguageObjectHook.

Definition at line 4234 of file HookRunner.php.

◆ onUserGetReservedNames()

MediaWiki\HookContainer\HookRunner::onUserGetReservedNames ( & $reservedUsernames)

Use this hook to modify $wgReservedUsernames at run time.

Since
1.35
Parameters
array&$reservedUsernames$wgReservedUsernames
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserGetReservedNamesHook.

Definition at line 4248 of file HookRunner.php.

◆ onUserGetRights()

MediaWiki\HookContainer\HookRunner::onUserGetRights ( $user,
& $rights )

This hook is called in PermissionManager::getUserPermissions().

Since
1.35
Parameters
User$userUser to get rights for
string[]&$rightsCurrent rights
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\UserGetRightsHook.

Definition at line 4255 of file HookRunner.php.

◆ onUserGetRightsRemove()

MediaWiki\HookContainer\HookRunner::onUserGetRightsRemove ( $user,
& $rights )

This hook is called in PermissionManager::getUserPermissions().

This hook overrides the UserGetRights hook. It can be used to remove rights from a user and ensure that they will not be reinserted by the other hook callbacks. This hook should not be used to add any rights; use UserGetRights instead.

Since
1.35
Parameters
User$userUser to get rights for
string[]&$rightsCurrent rights
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\UserGetRightsRemoveHook.

Definition at line 4262 of file HookRunner.php.

◆ onUserGroupsChanged()

MediaWiki\HookContainer\HookRunner::onUserGroupsChanged ( $user,
$added,
$removed,
$performer,
$reason,
$oldUGMs,
$newUGMs )

This hook is called after user groups are changed.

Since
1.35
Parameters
User | UserIdentity$userUser whose groups changed, for local group changes this is a User class, for interwiki group changes this was a UserRightsProxy until 1.40 and is a UserIdentity since 1.41
string[]$addedGroups added
string[]$removedGroups removed
User | false$performerUser who performed the change, false if via autopromotion
string | false$reasonThe reason, if any, given by the user performing the change, false if via autopromotion.
UserGroupMembership[]$oldUGMsAn associative array (group name => UserGroupMembership) of the user's group memberships before the change.
UserGroupMembership[]$newUGMsAn associative array (group name => UserGroupMembership) of the user's current group memberships.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserGroupsChangedHook.

Definition at line 4269 of file HookRunner.php.

◆ onUserIsBlockedFrom()

MediaWiki\HookContainer\HookRunner::onUserIsBlockedFrom ( $user,
$title,
& $blocked,
& $allowUsertalk )

Use this hook to check if a user is blocked from a specific page (for specific block exemptions if a user is already blocked).

Since
1.35
Parameters
User$userUser in question
Title$titleTitle of the page in question
bool&$blockedOut-param, whether or not the user is blocked from that page
bool&$allowUsertalkIf the user is blocked, whether or not the block allows users to edit their own user talk pages
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\UserIsBlockedFromHook.

Definition at line 4279 of file HookRunner.php.

◆ onUserIsBlockedGlobally()

MediaWiki\HookContainer\HookRunner::onUserIsBlockedGlobally ( $user,
$ip,
& $blocked,
& $block )

Use this hook to establish that a user is blocked on all wikis.

Since
1.35
Parameters
User$user
string$ipUser's IP address
bool&$blockedWhether the user is blocked, to be modified by the hook
null&$blockThe Block object, to be modified by the hook
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserIsBlockedGloballyHook.

Definition at line 4286 of file HookRunner.php.

◆ onUserIsBot()

MediaWiki\HookContainer\HookRunner::onUserIsBot ( $user,
& $isBot )

Use this hook to establish whether a user is a bot account.

Since
1.35
Parameters
User$user
bool&$isBotWhether this is user a bot or not (boolean)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserIsBotHook.

Definition at line 4293 of file HookRunner.php.

◆ onUserIsEveryoneAllowed()

MediaWiki\HookContainer\HookRunner::onUserIsEveryoneAllowed ( $right)

Use this hook to check if all users are allowed some user right; return false if a UserGetRights hook might remove the named right.

Since
1.35
Parameters
string$rightUser right being checked
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Permissions\Hook\UserIsEveryoneAllowedHook.

Definition at line 4300 of file HookRunner.php.

◆ onUserIsLocked()

MediaWiki\HookContainer\HookRunner::onUserIsLocked ( $user,
& $locked )

Use this hook to establish that a user is locked.

See User::isLocked().

Since
1.35
Parameters
User$userUser in question.
bool&$lockedSet true if the user should be locked.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserIsLockedHook.

Definition at line 4307 of file HookRunner.php.

◆ onUserLoadAfterLoadFromSession()

MediaWiki\HookContainer\HookRunner::onUserLoadAfterLoadFromSession ( $user)

This hook is called to authenticate users on external or environmental means.

This hook is called after session is loaded.

Since
1.35
Parameters
User$userUser object being loaded
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserLoadAfterLoadFromSessionHook.

Definition at line 4314 of file HookRunner.php.

◆ onUserLoadDefaults()

MediaWiki\HookContainer\HookRunner::onUserLoadDefaults ( $user,
$name )

This hook is called when loading a default user.

Since
1.35
Parameters
User$user
string$nameUser name
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserLoadDefaultsHook.

Definition at line 4321 of file HookRunner.php.

◆ onUserLoggedIn()

MediaWiki\HookContainer\HookRunner::onUserLoggedIn ( $user)

This hook is called after a user is logged in.

Since
1.35
Parameters
User$userUser object for the logged-in user
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Auth\Hook\UserLoggedInHook.

Definition at line 4336 of file HookRunner.php.

◆ onUserLoginComplete()

MediaWiki\HookContainer\HookRunner::onUserLoginComplete ( $user,
& $inject_html,
$direct )

Use this hook to show custom content after a user has logged in via the web interface.

This includes both login and signup. It's also called by the action=login API (but not action=clientlogin or action=createaccount) for legacy reasons.

For functionality that needs to run after any login (API or web) use UserLoggedIn.

Before 1.42 this hook was also called when the user visited the login page with a returnto parameter while already logged in. Code that needs to run in that situation should use the PostLoginRedirect hook instead.

Since
1.35
Parameters
User$userThe user object that was created on login
string&$inject_htmlAny HTML to inject after the "logged in" message. (Setting it to a non-empty value will also prevent redirects: instead of the user being sent back to the page indicated by the returnto URL parameter, they will see a success page with $inject_html and a link to the returnto page.) On signup, the BeforeWelcomeCreation hook can further modify this value.
bool$direct(bool) Unused, always true. Before 1.42, it was false when the hook was called in situations other than a successful login or signup; since 1.42 those don't happen anymore.
Returns
bool|void True or no return value to continue or false to abort
See also
BeforeWelcomeCreationHook::onBeforeWelcomeCreation

Implements MediaWiki\Hook\UserLoginCompleteHook.

Definition at line 4343 of file HookRunner.php.

◆ onUserLogout()

MediaWiki\HookContainer\HookRunner::onUserLogout ( $user)

This hook is called before a user logs out.

Since
1.35
Parameters
User$userThe user that is about to be logged out
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserLogoutHook.

Definition at line 4350 of file HookRunner.php.

◆ onUserLogoutComplete()

MediaWiki\HookContainer\HookRunner::onUserLogoutComplete ( $user,
& $inject_html,
$oldName )

This hook is called after a user has logged out.

Since
1.35
Parameters
User$userthe user object after logout (won't have name, ID, etc.)
string&$inject_htmlAny HTML to inject after the "logged out" message.
string$oldNamename of the user before logout (string)
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UserLogoutCompleteHook.

Definition at line 4357 of file HookRunner.php.

◆ onUserMailerChangeReturnPath()

MediaWiki\HookContainer\HookRunner::onUserMailerChangeReturnPath ( $to,
& $returnPath )

This hook is called to generate a VERP return address when UserMailer sends an email, with a bounce handling extension.

Since
1.35
Parameters
MailAddress[]$toArray of MailAddress objects for the recipients
string&$returnPathReturn address
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UserMailerChangeReturnPathHook.

Definition at line 4364 of file HookRunner.php.

◆ onUserMailerSplitTo()

MediaWiki\HookContainer\HookRunner::onUserMailerSplitTo ( & $to)

This hook is called in UserMailer::send() to give extensions a chance to split up an email with multiple To: fields into separate emails.

Since
1.35
Parameters
MailAddress[]&$toUnset the ones which should be mailed separately
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UserMailerSplitToHook.

Definition at line 4371 of file HookRunner.php.

◆ onUserMailerTransformContent()

MediaWiki\HookContainer\HookRunner::onUserMailerTransformContent ( $to,
$from,
& $body,
& $error )

This hook is called in UserMailer::send() to change email contents.

Since
1.35
Parameters
MailAddress[]$toArray of addresses of the targets
MailAddress$fromAddress of the sender
string | array&$bodyEmail body, either a string (for plaintext emails) or an array with 'text' and 'html' keys
string&$errorError message
Returns
bool|void True or no return value to continue, or false and set $error to block sending the email

Implements MediaWiki\Hook\UserMailerTransformContentHook.

Definition at line 4378 of file HookRunner.php.

◆ onUserMailerTransformMessage()

MediaWiki\HookContainer\HookRunner::onUserMailerTransformMessage ( $to,
$from,
& $subject,
& $headers,
& $body,
& $error )

This hook is called in UserMailer::send() to change email after it has gone through the MIME transform.

Since
1.35
Parameters
MailAddress[]$toArray of addresses of the targets
MailAddress$fromAddress of the sender
string&$subjectEmail subject (not MIME encoded)
array&$headersEmail headers (except To: and Subject:) as an array of header name => value pairs
string&$bodyemail body (in MIME format)
string&$errorError message
Returns
bool|void True or no return value to continue, or false and set $error to block sending the email

Implements MediaWiki\Hook\UserMailerTransformMessageHook.

Definition at line 4385 of file HookRunner.php.

◆ onUserPrivilegedGroups()

MediaWiki\HookContainer\HookRunner::onUserPrivilegedGroups ( $userIdentity,
& $groups )

Definition at line 4241 of file HookRunner.php.

◆ onUserRemoveGroup()

MediaWiki\HookContainer\HookRunner::onUserRemoveGroup ( $user,
& $group )

This hook is called when removing a group.

Since
1.35
Parameters
User$userThe user that is to have a group removed
string&$groupThe group to be removed. Can be modified.
Returns
bool|void True or no return value to continue or false to abort (override the stock group removal)

Implements MediaWiki\User\Hook\UserRemoveGroupHook.

Definition at line 4394 of file HookRunner.php.

◆ onUserSaveSettings()

MediaWiki\HookContainer\HookRunner::onUserSaveSettings ( $user)

This hook is called directly after user settings have been saved to the database.

Compare to the SaveUserOptions hook, which is called before saving and is only called for options managed by UserOptionsManager.

Since
1.35
Parameters
User$userThe User for which the settings have been saved
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserSaveSettingsHook.

Definition at line 4408 of file HookRunner.php.

◆ onUserSendConfirmationMail()

MediaWiki\HookContainer\HookRunner::onUserSendConfirmationMail ( $user,
& $mail,
$info )

This hook is called just before a confirmation email is sent to a user.

Hook handlers can modify the email that will be sent.

Since
1.35
Parameters
User$userThe User for which the confirmation email is going to be sent
array&$mailAssociative array describing the email, with the following keys:
  • subject: Subject line of the email
  • body: Email body. Can be a string, or an array with keys 'text' and 'html'
  • from: User object, or null meaning $wgPasswordSender will be used
  • replyTo: MailAddress object or null
array$infoAssociative array with additional information:
  • type: 'created' if the user's account was just created; 'set' if the user set an email address when they previously didn't have one; 'changed' if the user had an email address and changed it
  • ip: The IP address from which the user set/changed their email address
  • confirmURL: URL the user should visit to confirm their email
  • invalidateURL: URL the user should visit to invalidate confirmURL
  • expiration: time and date when confirmURL expires
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserSendConfirmationMailHook.

Definition at line 4415 of file HookRunner.php.

◆ onUserSetEmail()

MediaWiki\HookContainer\HookRunner::onUserSetEmail ( $user,
& $email )

This hook is called when changing user email address.

Since
1.35
Parameters
User$user
string&$emailnew email, change this to override new email address
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserSetEmailHook.

Definition at line 4422 of file HookRunner.php.

◆ onUserSetEmailAuthenticationTimestamp()

MediaWiki\HookContainer\HookRunner::onUserSetEmailAuthenticationTimestamp ( $user,
& $timestamp )

This hook is called when setting the timestamp of a User's email authentication.

Since
1.35
Parameters
User$user
?string&$timestampnew timestamp, change this to override local email authentication timestamp
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\User\Hook\UserSetEmailAuthenticationTimestampHook.

Definition at line 4429 of file HookRunner.php.

◆ onUsersPagerDoBatchLookups()

MediaWiki\HookContainer\HookRunner::onUsersPagerDoBatchLookups ( $dbr,
$userIds,
& $cache,
& $groups )

This hook is called in UsersPager::doBatchLookups()

It is used to give extensions providing user group data from an alternate source a chance to add their data into the cache array so that things like global user groups are displayed correctly in Special:ListUsers.

Since
1.35
Parameters
IReadableDatabase$dbrRead-only database handle
int[]$userIdsArray of user IDs whose groups we should look up
array&$cacheArray of user ID -> (array of internal group name (e.g. 'sysop') -> UserGroupMembership object)
array&$groupsArray of group name -> bool true mappings for members of a given user group
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UsersPagerDoBatchLookupsHook.

Definition at line 4436 of file HookRunner.php.

◆ onUserToolLinksEdit()

MediaWiki\HookContainer\HookRunner::onUserToolLinksEdit ( $userId,
$userText,
& $items )

This hook is called when generating a list of user tool links, e.g.

"Foobar (Talk | Contribs | Block)".

Since
1.35
Parameters
int$userIdUser ID of the current user
string$userTextUsername of the current user
string[]&$itemsArray of user tool links as HTML fragments
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\UserToolLinksEditHook.

Definition at line 4443 of file HookRunner.php.

◆ onValidateExtendedMetadataCache()

MediaWiki\HookContainer\HookRunner::onValidateExtendedMetadataCache ( $timestamp,
$file )

Use this hook to validate the cached metadata in FormatMetadata::getExtendedMeta.

Since
1.35
Parameters
string$timestampTimestamp metadata was generated
File$fileFile the metadata is for
Returns
bool|void True or no return value to continue, or false to invalidate cache and call GetExtendedMetadata hook again

Implements MediaWiki\Hook\ValidateExtendedMetadataCacheHook.

Definition at line 4457 of file HookRunner.php.

◆ onWantedPages__getQueryInfo()

MediaWiki\HookContainer\HookRunner::onWantedPages__getQueryInfo ( $wantedPages,
& $query )

This hook is called in SpecialWantedPages::getQueryInfo().

Can be used to alter the SQL query.

Since
1.35
Parameters
SpecialWantedPages$wantedPages
array&$queryQuery array. See QueryPage::getQueryInfo() for format documentation.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\WantedPages__getQueryInfoHook.

Definition at line 4464 of file HookRunner.php.

◆ onWatchArticle()

MediaWiki\HookContainer\HookRunner::onWatchArticle ( $user,
$page,
& $status,
$expiry )

This hook is called before a watch is added to an article.

Since
1.35
Parameters
User$userUser that will watch
WikiPage$pageWikiPage object to be watched
Status&$statusStatus object to be returned if the hook returns false
string | null$expiryOptional expiry timestamp in any format acceptable to wfTimestamp()
Returns
bool|void True or no return value to continue or false to abort and return Status object

Implements MediaWiki\Hook\WatchArticleHook.

Definition at line 4471 of file HookRunner.php.

◆ onWatchArticleComplete()

MediaWiki\HookContainer\HookRunner::onWatchArticleComplete ( $user,
$page )

This hook is called after a watch is added to an article.

Since
1.35
Parameters
User$userUser that watched
WikiPage$pageWikiPage object watched
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\WatchArticleCompleteHook.

Definition at line 4478 of file HookRunner.php.

◆ onWatchedItemQueryServiceExtensions()

MediaWiki\HookContainer\HookRunner::onWatchedItemQueryServiceExtensions ( & $extensions,
$watchedItemQueryService )

Use this hook to create a WatchedItemQueryServiceExtension.

Since
1.35
Parameters
array&$extensionsAdd WatchedItemQueryServiceExtension objects to this array
WatchedItemQueryService$watchedItemQueryServiceService object
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\WatchedItemQueryServiceExtensionsHook.

Definition at line 4485 of file HookRunner.php.

◆ onWatchlistEditorBeforeFormRender()

MediaWiki\HookContainer\HookRunner::onWatchlistEditorBeforeFormRender ( & $watchlistInfo)

This hook is called before building the Special:EditWatchlist form.

It is used to manipulate the list of pages or preload data based on that list.

Since
1.35
Parameters
array&$watchlistInfoArray of watchlisted pages in [namespaceId => ['title1' => 1, 'title2' => 1]] format
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\WatchlistEditorBeforeFormRenderHook.

Definition at line 4494 of file HookRunner.php.

◆ onWatchlistEditorBuildRemoveLine()

MediaWiki\HookContainer\HookRunner::onWatchlistEditorBuildRemoveLine ( & $tools,
$title,
$redirect,
$skin,
& $link )

This hook is called when building remove lines in Special:Watchlist/edit.

Since
1.35
Parameters
string[]&$toolsArray of extra HTML links
Title$title
bool$redirectwhether the page is a redirect
Skin$skin
string&$linkHTML link to title
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\WatchlistEditorBuildRemoveLineHook.

Definition at line 4501 of file HookRunner.php.

◆ onWebRequestPathInfoRouter()

MediaWiki\HookContainer\HookRunner::onWebRequestPathInfoRouter ( $router)

This hook is called while building the MediaWiki\Request\PathRouter to parse the REQUEST_URI.

Parameters
\\MediaWiki\\Request\\PathRouter$router
Returns
bool|void True or no return value to continue or false to abort
Since
1.35

Implements MediaWiki\Hook\WebRequestPathInfoRouterHook.

Definition at line 4510 of file HookRunner.php.

◆ onWebResponseSetCookie()

MediaWiki\HookContainer\HookRunner::onWebResponseSetCookie ( & $name,
& $value,
& $expire,
& $options )

This hook is called when setting a cookie in WebResponse::setcookie().

Since
1.35
Parameters
string&$nameCookie name passed to WebResponse::setcookie()
string&$valueCookie value passed to WebResponse::setcookie()
int | null&$expireCookie expiration, as for PHP's setcookie()
array&$optionsOptions passed to WebResponse::setcookie()
Returns
bool|void True or no return value to continue, or false to prevent setting of the cookie

Implements MediaWiki\Hook\WebResponseSetCookieHook.

Definition at line 4517 of file HookRunner.php.

◆ onWfShellWikiCmd()

MediaWiki\HookContainer\HookRunner::onWfShellWikiCmd ( & $script,
& $parameters,
& $options )

This hook is called when generating a shell-escaped command line string to run a MediaWiki CLI script.

Since
1.35
Parameters
string&$scriptMediaWiki CLI script path
string[]&$parametersArray of arguments and options to the script
array&$optionsAssociative array of options, may contain the 'php' and 'wrapper' keys
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Shell\Hook\WfShellWikiCmdHook.

Definition at line 4524 of file HookRunner.php.

◆ onWgQueryPages()

MediaWiki\HookContainer\HookRunner::onWgQueryPages ( & $qp)

This hook is called when initialising list of QueryPage subclasses.

Use this hook to add new query pages to be updated with maintenance/updateSpecialPages.php.

Since
1.35
Parameters
array[]&$qpList of QueryPages Format: [ string $class, string $specialPageName, ?int $limit (optional) ]. Limit defaults to $wgQueryCacheLimit if not given.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\SpecialPage\Hook\WgQueryPagesHook.

Definition at line 4531 of file HookRunner.php.

◆ onWhatLinksHereProps()

MediaWiki\HookContainer\HookRunner::onWhatLinksHereProps ( $row,
$title,
$target,
& $props )

Use this hook to add annotations to Special:WhatLinksHere.

Since
1.35
Parameters
stdClass$rowThe DB row of the entry.
Title$titleThe Title of the page where the link comes FROM
Title$targetThe Title of the page where the link goes TO
string[]&$propsArray of HTML strings to display after the title.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\WhatLinksHerePropsHook.

Definition at line 4538 of file HookRunner.php.

◆ onWikiExporter__dumpStableQuery()

MediaWiki\HookContainer\HookRunner::onWikiExporter__dumpStableQuery ( & $tables,
& $opts,
& $join )

Use this hook to get the SELECT query for "stable" revisions dumps.

One, and only one hook should set this, and return false.

Since
1.35
Parameters
array&$tablesDatabase tables to use in the SELECT query
array&$optsOptions to use for the query
array&$joinJoin conditions
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\WikiExporter__dumpStableQueryHook.

Definition at line 4545 of file HookRunner.php.

◆ onWikiPageDeletionUpdates()

MediaWiki\HookContainer\HookRunner::onWikiPageDeletionUpdates ( $page,
$content,
& $updates )

Use this hook to manipulate the list of DeferrableUpdates to be applied when a page is deleted.

Since
1.35
Parameters
WikiPage$page
Content | null$contentContent to generate updates for, or null in case the page revision could not be loaded. The delete will succeed despite this.
DeferrableUpdate[]&$updatesArray of objects that implement DeferrableUpdate. Hook function may want to add to it.
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\WikiPageDeletionUpdatesHook.

Definition at line 4552 of file HookRunner.php.

◆ onWikiPageFactory()

MediaWiki\HookContainer\HookRunner::onWikiPageFactory ( $title,
& $page )

Use this hook to override WikiPage class used for a title.

Since
1.35
Parameters
Title$titleTitle of the page
WikiPage | null&$pageVariable to set the created WikiPage to
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Page\Hook\WikiPageFactoryHook.

Definition at line 4559 of file HookRunner.php.

◆ onXmlDumpWriterOpenPage()

MediaWiki\HookContainer\HookRunner::onXmlDumpWriterOpenPage ( $obj,
& $out,
$row,
$title )

This hook is called at the end of XmlDumpWriter::openPage, to allow extra metadata to be added.

Since
1.35
Parameters
XmlDumpWriter$obj
string&$outOutput string
stdClass$rowDatabase row for the page
Title$titleTitle of the page
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\XmlDumpWriterOpenPageHook.

Definition at line 4566 of file HookRunner.php.

◆ onXmlDumpWriterWriteRevision()

MediaWiki\HookContainer\HookRunner::onXmlDumpWriterWriteRevision ( $obj,
& $out,
$row,
$text,
$rev )

This hook is called at the end of a revision in an XML dump, to add extra metadata.

Since
1.35
Parameters
XmlDumpWriter$obj
string&$outText being output
stdClass$rowDatabase row for the revision being dumped. DEPRECATED, use $rev instead.
string$textRevision text to be dumped. DEPRECATED, use $rev instead.
RevisionRecord$revRevisionRecord that is being dumped to XML
Returns
bool|void True or no return value to continue or false to abort

Implements MediaWiki\Hook\XmlDumpWriterWriteRevisionHook.

Definition at line 4573 of file HookRunner.php.


The documentation for this class was generated from the following file: