From 8223023be39e5d763e51287b7d86321398cf7018 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sun, 20 Sep 2015 22:50:19 +0100 Subject: [PATCH] Add $suppress to ArticleDelete hook We should be telling extensions whether a deletion is a suppression or not, so they can behave appropriately. Change-Id: I2cb6ffd61dd12766fe0266514c9360ff0c90b788 --- docs/hooks.txt | 1 + includes/page/WikiPage.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 0e76d58a74..8d3660374d 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -575,6 +575,7 @@ $error: if the deletion was prohibited, the (raw HTML) error message to display (added in 1.13) $status: Status object, modify this to throw an error. Overridden by $error (added in 1.20) +$suppress: Whether this is a suppression deletion or not (added in 1.27) 'ArticleDeleteAfterSuccess': Output after an article has been deleted. $title: Title of the article that has been deleted. diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index d656bad195..ee13ea37d9 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2780,7 +2780,7 @@ class WikiPage implements Page, IDBAccessObject { $user = is_null( $user ) ? $wgUser : $user; if ( !Hooks::run( 'ArticleDelete', - array( &$this, &$user, &$reason, &$error, &$status ) + array( &$this, &$user, &$reason, &$error, &$status, $suppress ) ) ) { if ( $status->isOK() ) { // Hook aborted but didn't set a fatal status -- 2.20.1