Manual:Hooks/PageUndelete

From Linux Web Expert

PageUndelete
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Run before page undeletion
<translate> Define function:</translate>
public static function onPageUndelete( ProperPageIdentity $page, Authority $performer, string $reason, bool $unsuppress, array $timestamps, array $fileVersions, StatusValue $status ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"PageUndelete": "MediaWiki\\Extension\\MyExtension\\Hooks::onPageUndelete"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> page/UndeletePage.php
<translate> Interface:</translate> PageUndeleteHook.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:PageUndelete extensions</tvar>.</translate>


This hook is fired by UndeletePage before performing any undeletion, and allows callers to perform additional actions or abort the operation.