Manual:Hooks/UnwatchArticle

From mediawiki.org
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": "MediaWiki\\Extension\\MyExtension\\Hooks::onUnwatchArticle"
	}
}
Called from: File(s): page/Article.php
Interface: UnwatchArticleHook.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]