Manual:Hooks/WatchArticle

WatchArticle
Available from version 1.4.0
Occurs whenever the software receives a request to watch an article
Define function:
public static function onWatchArticle( $user, $article, &$status ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"WatchArticle": "MediaWiki\\Extension\\MyExtension\\Hooks::onWatchArticle"
	}
}
Called from: File(s): page/Article.php
Interface: WatchArticleHook.php

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


Details

edit
  • $user: user that will watch
  • $page: WikiPage object to be watched
  • &$status: Status object to be returned if the hook returns false

See also

edit