Jump to content

User:Leucosticte/Hooks/PageContentSaveRevision

From mediawiki.org
PageContentSaveRevision
Available from version 1.23.0
Before an article is saved.
Define function:
public static function onPageContentSaveRevision( $wikiPage, $user, $content, $summary, <br/>$isMinor, $flags, $status, &$revision ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"PageContentSaveRevision": "MediaWiki\\Extension\\MyExtension\\Hooks::onPageContentSaveRevision"
	}
}
Called from: File(s): WikiPage.php
Interface: PageContentSaveRevisionHook.php

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


This hook doesn't exist yet, except on Leucosticte's private test wiki. It may eventually be added in an upcoming Gerrit change.

Details

[edit]
  • $wikiPage: the WikiPage (object) being saved
  • $user: the User (object) saving the article
  • $content: the new article content, as a Content object
  • $summary: the article summary (comment)
  • $isMinor: minor flag
  • $revision: revision object