Manual:Hooks/PageDelete

From Linux Web Expert

Revision as of 07:29, 13 November 2023 by imported>Clump (Reverted edits by 180.249.185.123 (talk) to last version by Clump)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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