Manual:Hooks/ParserLimitReportPrepare

From MediaWiki.org
Jump to navigation Jump to search
ParserLimitReportPrepare
Available from version 1.22.0
Called at the end of Parser:parse() when the parser will include comments about size of the text parsed.
Define function:
public static function onParserLimitReportPrepare( $parser, $output ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ParserLimitReportPrepare": "MyExtensionHooks::onParserLimitReportPrepare"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ParserLimitReportPrepare'][] = 'MyExtensionHooks::onParserLimitReportPrepare';
Called from:File(s): Parser.php
Function(s): makeLimitReport

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

Hooks should use $output->setLimitReportData() to populate data. Functions for this hook should not use $wgLang; do that in ParserLimitReportFormat instead.

Details[edit]

  • $parser: Parser object
  • $output: ParserOutput object