Manual:Hooks/PageDelete

PageDelete
Available from version 1.37.0
Occurs whenever the software receives a request to delete an article
Define function:
public static function onPageDelete( ProperPageIdentity $page, Authority $deleter, string $reason, StatusValue $status, bool $suppress ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"PageDelete": "MediaWiki\\Extension\\MyExtension\\Hooks::onPageDelete"
	}
}
Called from: File(s): page/DeletePage.php
Interface: PageDeleteHook.php

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

Details

edit
  • $page: the page that is being deleted
  • $deleter: the user (object) deleting the article
  • $reason: the reason (string) the page is being deleted
  • $status: the current status of the deletion
  • $suppress: whether the contents of the deleted page will be kept hidden from administrators

See also

edit