Jump to content

Manual:Hooks/NewRevisionFromEditComplete

From mediawiki.org
NewRevisionFromEditComplete
Available from version 1.13.0
Removed in version 1.37.0 (Gerrit change 678414)
Called when a revision was inserted due to an edit.
Define function:
public static function onNewRevisionFromEditComplete( WikiPage $wikiPage, Revision $rev, $baseID, User $user ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"NewRevisionFromEditComplete": "MediaWiki\\Extension\\MyExtension\\Hooks::onNewRevisionFromEditComplete"
	}
}
Called from: File(s): filerepo/file/LocalFile.php, MovePage.php, page/WikiPage.php, specials/helpers/ImportReporter.php, Storage/PageUpdater.php
Interface: NewRevisionFromEditCompleteHook.php

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


Details

[edit]
  • WikiPage $wikiPage: the wiki page edited (WikiPage object) 1.19+
  • Revision $rev: the new revision (Revision object)
  • int|null $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 $user: the revision author (User object)