Manual:Hooks/UnwatchArticle

From MediaWiki.org
Jump to: navigation, search
UnwatchArticle
Available from version 1.4.0
Occurs whenever the software receives a request to unwatch an article
Define function:
public static function onUnwatchArticle( $user, $article, &$status ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UnwatchArticle": "MyExtensionHooks::onUnwatchArticle"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UnwatchArticle'][] = 'MyExtensionHooks::onUnwatchArticle';
Called from: File(s): Article.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:UnwatchArticle extensions.

Details[edit]

  • $user: user watching
  • $page: WikiPage object to be removed
  • &$status: Status object to be returned if the hook returns false

See also[edit]