Manual:Hooks/PageDelete

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
PageDelete
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Occurs whenever the software receives a request to delete an article
<translate> Define function:</translate>
public static function onPageDelete( ProperPageIdentity $page, Authority $deleter, string $reason, StatusValue $status, bool $suppress ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"PageDelete": "MediaWiki\\Extension\\MyExtension\\Hooks::onPageDelete"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> page/DeletePage.php
<translate> Interface:</translate> PageDeleteHook.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:PageDelete extensions</tvar>.</translate>

Details

  • $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