Manual:Hooks/ParserBeforePreprocess: Difference between revisions
Appearance
m 1 revision imported: Initial |
|
(No difference)
|
Latest revision as of 17:03, 29 December 2024
ParserBeforePreprocess | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 589458)</tvar></translate> Called at the beginning of Parser::preprocess() | |
<translate> Define function:</translate> | public static function onParserBeforePreprocess( Parser $parser, string &$text, StripState $stripState ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"ParserBeforePreprocess": "MediaWiki\\Extension\\MyExtension\\Hooks::onParserBeforePreprocess"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> parser/Parser.php <translate> Function(s):</translate> preprocess |
<translate> Interface:</translate> | ParserBeforePreprocessHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:ParserBeforePreprocess extensions</tvar>.</translate>
Parameters
$parser
: An instance ofParser
&$text
: A modifiablestring
, representing the text to parse$stripState
: An instance ofStripState