Manual:Hooks/ArticleDelete
Appearance
From mediawiki.org
Deprecated: This feature is deprecated and should no longer be used, however it is possibly still available for reasons of backwards compatibility . This feature was deprecated in version 1.37.0. See PageDelete for an alternative way to use this feature.
| ArticleDelete | |
|---|---|
| Available from version 1.4.0 Occurs whenever the software receives a request to delete an article | |
| Define function: | public static function onArticleDelete( WikiPage &$article, User &$user, &$reason, &$error ) { ... } |
| Attach hook: | In extension.json:
{ "Hooks":{ "ArticleDelete":"MediaWiki\\Extension\\MyExtension\\Hooks::onArticleDelete" } } |
| Called from: | File(s): page/DeletePage.php |
| Interface: | ArticleDeleteHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ArticleDelete extensions.
Details
[edit ]$article: the article that was deleted (WikiPageobject) 1.18+$user: the user (object) deleting the article$reason: the reason (string) the article is being deleted$error: if the requested article deletion was prohibited, the (raw HTML) error message to display 1.13+