Jump to content

Manual:Hooks/EditPageGetDiffContent

From mediawiki.org
Revision as of 02:14, 1 May 2024 by 2601:195:4000:44b0:5043:4abb:b11e:1911 (talk) (Fix link to EditPage.php)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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/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"