MediaWiki REL1_39
MediaWiki\Page\Hook\ArticleDeleteHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inheritance diagram for MediaWiki\Page\Hook\ArticleDeleteHook:

Public Member Functions

 onArticleDelete (WikiPage $wikiPage, User $user, &$reason, &$error, Status &$status, $suppress)
 This hook is called before an article is deleted.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ArticleDelete" to register handlers implementing this interface.

Deprecated
since 1.37, use PageDeleteHook instead. The new hook uses more modern typehints and requires callers to add errors to $status, rather than the $error parameter.

Definition at line 17 of file ArticleDeleteHook.php.

Member Function Documentation

◆ onArticleDelete()

MediaWiki\Page\Hook\ArticleDeleteHook::onArticleDelete ( WikiPage $wikiPage,
User $user,
& $reason,
& $error,
Status & $status,
$suppress )

This hook is called before an article is deleted.

Since
1.35
Parameters
WikiPage$wikiPageWikiPage being deleted
User$userUser deleting the article
string&$reasonReason the article is being deleted
string&$errorIf the deletion was prohibited, the (raw HTML) error message to display (added in 1.13)
Status&$statusModify this to throw an error. Overridden by $error (added in 1.20)
bool$suppressWhether this is a suppression deletion or not (added in 1.27)
Returns
bool|void True or no return value to continue or false to abort

The documentation for this interface was generated from the following file: