Manual:Hooks/RevisionUndeleted

From Linux Web Expert

RevisionUndeleted
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 584098)</tvar></translate>
Called after an article revision is restored
<translate> Define function:</translate>
public static function onRevisionUndeleted( MediaWiki\Revision\RevisionRecord $restoredRevision, ?int $oldPageId ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"RevisionUndeleted": "MediaWiki\\Extension\\MyExtension\\Hooks::onRevisionUndeleted"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> page/PageArchive.php
<translate> Function(s):</translate> undeleteRevisions
<translate> Interface:</translate> RevisionUndeletedHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:RevisionUndeleted extensions</tvar>.</translate>


Details

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