Manual:Hooks/EditPageGetDiffText

From Linux Web Expert

EditPageGetDiffText
<translate> Available from <tvar name=1><translate> version <tvar (r62740, codereview)</tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar </tvar></translate>
Allow modifying the wikitext that will be used in "Show changes"
<translate> Define function:</translate>
public static function onEditPageGetDiffText( $editPage, &$newtext ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"EditPageGetDiffText": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditPageGetDiffText"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> EditPage.php
<translate> Interface:</translate> EditPageGetDiffTextHook.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:EditPageGetDiffText extensions</tvar>.</translate>


Details

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