Manual:Hooks/ParserBeforePreprocess

Category:MediaWiki hooks#ParserBeforePreprocess Category:Hooks added in MediaWiki 1.35.0#ParserBeforePreprocess
ParserBeforePreprocess
Available from version 1.35.0 (Gerrit change 589458)
Called at the beginning of Parser::preprocess()
Define function:
public static function onParserBeforePreprocess( Parser $parser, string &$text, StripState $stripState ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ParserBeforePreprocess": "MediaWiki\\Extension\\MyExtension\\Hooks::onParserBeforePreprocess"
	}
}
Called from: File(s): parser/Parser.phpCategory:MediaWiki hooks included in Parser.php#ParserBeforePreprocess
Function(s): preprocess
Interface: ParserBeforePreprocessHook.php

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

Parameters

  • $parser: An instance of Parser
  • &$text: A modifiable string, representing the text to parse
  • $stripState: An instance of StripState
Category:Hooks added in MediaWiki 1.35.0 Category:MediaWiki hooks Category:MediaWiki hooks included in Parser.php