Manual:Hooks/RevisionUndeleted

From mediawiki.org
Jump to navigation Jump to search
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": "MyExtensionHooks::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)