Manual:Hooks/DiffRevisionTools

From MediaWiki.org
Jump to navigation Jump to search
DiffRevisionTools
Available from version 1.21.0 (Gerrit change 52579)
Override or extend the revision tools available from the diff view, i.e. undo, etc.
Define function:
public static function onDiffRevisionTools( Revision $newRev, &$links, $oldRev ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"DiffRevisionTools": "MyExtensionHooks::onDiffRevisionTools"
	}
}

For MediaWiki ≤1.25:

$wgHooks['DiffRevisionTools'][] = 'MyExtensionHooks::onDiffRevisionTools';
Called from:File(s): diff/DifferenceEngine.php

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

Details[edit]

  • $newRev: Revision object of the "new" revision
  • &$links: Array of HTML links
  • $oldRev: Revision object of the "old" revision (may be null) (since 1.23)

See also[edit]