Manual:Hooks/ParserCloned

From MediaWiki.org
Jump to: navigation, search
ParserCloned
Available from version 1.21.0 (Gerrit change 33506)
called when the Parser is cloned
Define function:
public static function onParserCloned( $parser ) { ... }
Attach hook:
$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.

Details[edit]

$parser: Newly-cloned Parser object

Purpose[edit]

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.