Manual:Hooks/NewRevisionFromEditComplete

From MediaWiki.org
Jump to: navigation, search
NewRevisionFromEditComplete
Available from version 1.13.0
Called when a revision was inserted due to an edit.
Define function:
public static function onNewRevisionFromEditComplete( $article, Revision $rev, $baseID, User $user ) { ... }
Attach hook:
$wgHooks['NewRevisionFromEditComplete'][] = 'MyExtensionHooks::onNewRevisionFromEditComplete';
Called from: File(s): LocalFile.php, SpecialImport.php, Article.php, Title.php

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

Details[edit]

  • $article: the article 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