From e4cfd3da01053c576fe5bcb0f62eefa65033357e Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Sat, 1 Nov 2014 21:39:52 +0100 Subject: [PATCH] Add an "ArticleDeleteAfterSuccess" hook So that we can show what Wikibase did after the deletion. Change-Id: If99be002973e68c84125158ff9747b140fb38ea1 --- docs/hooks.txt | 4 ++++ includes/page/Article.php | 3 +++ 2 files changed, 7 insertions(+) diff --git a/docs/hooks.txt b/docs/hooks.txt index 52eeab8356..d24c66d22e 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -528,6 +528,10 @@ $error: if the deletion was prohibited, the (raw HTML) error message to display $status: Status object, modify this to throw an error. Overridden by $error (added in 1.20) +'ArticleDeleteAfterSuccess': Output after an article has been deleted. +$title: Title of the article that has been deleted. +$outputPage: OutputPage that can be used to append the output. + 'ArticleDeleteComplete': After an article is deleted. $wikiPage: the WikiPage that was deleted $user: the user that deleted the article diff --git a/includes/page/Article.php b/includes/page/Article.php index 54fab29a55..ac86e8f799 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1807,6 +1807,9 @@ class Article implements Page { $loglink = '[[Special:Log/delete|' . wfMessage( 'deletionlog' )->text() . ']]'; $outputPage->addWikiMsg( 'deletedtext', wfEscapeWikiText( $deleted ), $loglink ); + + wfRunHooks( 'ArticleDeleteAfterSuccess', array( $this->getTitle(), $outputPage ) ); + $outputPage->returnToMain( false ); } else { $outputPage->setPageTitle( -- 2.20.1