Manual:Hooks/NewRevisionFromEditComplete

From Linux Web Expert

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

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:NewRevisionFromEditComplete extensions</tvar>.</translate>


Details

  • 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)