Open main menu


< Manual:Hooks
Available from version 1.13.0
Called when a revision was inserted due to an edit.
Define function:
public static function onNewRevisionFromEditComplete( $wikiPage, Revision $rev, $baseID, User $user ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"NewRevisionFromEditComplete": "MyExtensionHooks::onNewRevisionFromEditComplete"

For MediaWiki ≤1.25:

$wgHooks['NewRevisionFromEditComplete'][] = 'MyExtensionHooks::onNewRevisionFromEditComplete';
Called from:File(s): LocalFile.php, WikiPage.php

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


  • $wikiPage: the wikipage edited. This is a WikiPage object as of MediaWiki 1.19, and an Article one before
  • $rev: the new revision. Revision object
  • $baseID: the revision ID this was based off, if any. For example, for a rollback, this will be the rev_id that is being rolled back to.
  • $user: the revision author. User object