Manual:Hooks/EditPageBeforeConflictDiff

From Linux Web Expert

EditPageBeforeConflictDiff
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Allows modifying the EditPage object and output when there's an edit conflict.
<translate> Define function:</translate>
public static function onEditPageBeforeConflictDiff( &$editor, &$out ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"EditPageBeforeConflictDiff": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditPageBeforeConflictDiff"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> EditPage.php
<translate> Interface:</translate> EditPageBeforeConflictDiffHook.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:EditPageBeforeConflictDiff extensions</tvar>.</translate>

Details

Return false to halt normal diff output; in this case you're responsible for computing and outputting the entire "conflict" part, i.e., the "difference between revisions" and "your text" headers and sections.

  • &$editor: EditPage instance
  • &$out: OutputPage instance