Jump to content

Manual:Hooks/RevisionUndeleted

From mediawiki.org
Revision as of 16:57, 17 August 2020 by SamanthaNguyen (talk | contribs) (document hook)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
RevisionUndeleted
Available from version 1.35.0 (Gerrit change 584098)
Called after an article revision is restored
Define function:
public static function onRevisionUndeleted( MediaWiki\Revision\RevisionRecord $restoredRevision, ?int $oldPageId ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"RevisionUndeleted": "MediaWiki\\Extension\\MyExtension\\Hooks::onRevisionUndeleted"
	}
}
Called from: File(s): page/PageArchive.php
Function(s): undeleteRevisions
Interface: RevisionUndeletedHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:RevisionUndeleted extensions.


Details

[edit]
  • $restoredRevision: A MediaWiki\Revision\RevisionRecord object
  • $oldPageId: An int (or null), representing the page ID (added in gerrit:588815)