Manual:Hooks/EditPageBeforeConflictDiff

From MediaWiki.org
Jump to navigation Jump to search
EditPageBeforeConflictDiff
Available from version 1.13.0
Allows modifying the EditPage object and output when there's an edit conflict.
Define function:
public static function onEditPageBeforeConflictDiff( &$editor, &$out ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"EditPageBeforeConflictDiff": "MyExtensionHooks::onEditPageBeforeConflictDiff"
	}
}

For MediaWiki ≤1.25:

$wgHooks['EditPageBeforeConflictDiff'][] = 'MyExtensionHooks::onEditPageBeforeConflictDiff';
Called from:File(s): EditPage.php

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

Details[edit]

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