Manual:Hooks/NewDifferenceEngine

From MediaWiki.org
Jump to navigation Jump to search
Other languages:
English • ‎čeština • ‎日本語
NewDifferenceEngine
Available from version 1.15.0
Called when a new DifferenceEngine object is made.
Define function:
public static function onNewDifferenceEngine( $title, &$oldId, &$newId, $old, $new ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"NewDifferenceEngine": "MyExtensionHooks::onNewDifferenceEngine"
	}
}

For MediaWiki ≤1.25:

$wgHooks['NewDifferenceEngine'][] = 'MyExtensionHooks::onNewDifferenceEngine';
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:NewDifferenceEngine extensions.

Details[edit]

  • $title: the diff page title (nullable)
  • &$oldId: the actual old Id to use in the diff
  • &$newId: the actual new Id to use in the diff (0 means current)
  • $old: the ?old= param value from the url
  • $new: the ?new= param value from the url