Manual:Hooks/RevisionUndeleted

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)