Manual:Hooks/RevisionInsertComplete

From MediaWiki.org
Jump to navigation Jump to search
RevisionInsertComplete
Available from version 1.13.0
Called after a revision is inserted into the DB
Define function:
public static function onRevisionInsertComplete( &$revision, $data, $flags ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"RevisionInsertComplete": "MyExtensionHooks::onRevisionInsertComplete"
	}
}

For MediaWiki ≤1.25:

$wgHooks['RevisionInsertComplete'][] = 'MyExtensionHooks::onRevisionInsertComplete';
Called from:File(s): Revision.php

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

Details[edit]

  • &$revision: the Revision object
  • $data: URL to external object (deprecated in 1.31.0) Since 1.31.0, this will always return null.
  • $flags: flags for this revision (deprecated in 1.31.0) Since 1.31.0, this will always return null.