Manual:Hooks/RevisionDataUpdates

RevisionDataUpdates
Available from version 1.32.0 (Gerrit change 418134)
Called when constructing a list of DeferrableUpdate to be executed to record secondary data about a revision.
Define function:
public static function onRevisionDataUpdates( Title $title, \MediaWiki\Revision\RenderedRevision $renderedRevision, array &$updates ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"RevisionDataUpdates": "MyExtensionHooks::onRevisionDataUpdates"
	}
}

For MediaWiki ≤1.25:

$wgHooks['RevisionDataUpdates'][] = 'MyExtensionHooks::onRevisionDataUpdates';
Called from:File(s): Storage/DerivedPageDataUpdater.php
Function(s): getSecondaryDataUpdates

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

DetailsEdit

  • $title: The Title of the page the revision belongs to
  • $renderedRevision: a MediaWiki\Revision\RenderedRevision object representing the new revision and providing access to the RevisionRecord as well as ParserOutput of that revision.
  • &$updates: A list of DeferrableUpdate objects that can be manipulated by the hook handler.

See alsoEdit