Manual:Hooks/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.php
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 edit

  • $parser: An instance of Parser
  • &$text: A modifiable string, representing the text to parse
  • $stripState: An instance of StripState