- if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason)) ) {
- if( $article->doDeleteArticle( $reason, $suppress, $id ) )
+ $error = '';
+ if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, &$error)) ) {
+ if( $article->doDeleteArticle( $reason, $suppress, $id ) ) {
+ global $wgRequest;
+ if( $wgRequest->getCheck( 'wpWatch' ) ) {
+ $article->doWatch();
+ } elseif( $title->userIsWatching() ) {
+ $article->doUnwatch();
+ }