Manual:Hooks/PageViewUpdates

PageViewUpdates
Available from version 1.25.0
Called after a page view is seen by MediaWiki. Note this does not capture views made via external caches such as Squid.
Define function:
public static function onPageViewUpdates( WikiPage $wikipage, User $user ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"PageViewUpdates": "MediaWiki\\Extension\\MyExtension\\Hooks::onPageViewUpdates"
	}
}
Called from: File(s): page/WikiPage.php
Interface: PageViewUpdatesHook.php

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

Details

edit
  • $wikipage: WikiPage for the page being viewed.
  • $user: User for the user who is viewing.