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): Specials/SpecialEditWatchlist.phpCategory:MediaWiki hooks included in SpecialEditWatchlist.php#WatchArticle, Watchlist/WatchlistManager.phpCategory:MediaWiki hooks included in WatchlistManager.php#WatchArticle |
| Interface: | WatchArticleHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:WatchArticle extensions.
Details
- $user: user that will watch
- $page: WikiPage object to be watched
- &$status: Status object to be returned if the hook returns false