Manual:Hooks/EditPageGetDiffContent

EditPageGetDiffContent
Available from version 1.21.0
Allow modifying the wikitext that will be used in "Show changes". Note that it is preferable to implement diff handling for different data types using the ContentHandler facility.
Define function:
public static function onEditPageGetDiffContent( $editPage, &$newtext ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"EditPageGetDiffContent": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditPageGetDiffContent"
	}
}
Called from: File(s): EditPage.php
Interface: EditPageGetDiffContentHook.php

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

Details edit

  • $editPage: The EditPage object
  • &$newtext: wikitext that will be used as "your version"