Available from version 1.21.0 (Gerrit change 33506)
called when the Parser is cloned
Define function:
public static function onParserCloned( $parser ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"ParserCloned": "MyExtensionHooks::onParserCloned"

For MediaWiki ≤1.25:

$wgHooks['ParserCloned'][] = 'MyExtensionHooks::onParserCloned';
Called from:File(s): Parser.php

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


$parser: Newly-cloned Parser object


Extensions should use this hook if they store per-instance data in "expando" properties on the Parser object that need to be deep-cloned or cleared for the new Parser object.