Manual:Hooks/ParserBeforeStrip
This feature was removed completely in version 1.36.0 (after being deprecated in 1.35.0). |
ParserBeforeStrip | |
---|---|
Available from version 1.5.0 Removed in version 1.36.0 Used to process the raw wiki code before any internal processing is applied | |
Define function: | public static function onParserBeforeStrip( &$parser, &$text, &$strip_state ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"ParserBeforeStrip": "MyExtensionHooks::onParserBeforeStrip"
}
}
|
Called from: | File(s): parser/Parser.php |
Interface: | ParserBeforeStripHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ParserBeforeStrip extensions.
DetailsEdit
Note that this hook is not run on cached page content. And is also run when parsing system messages in addition to the page text.
$text will hold the text being parsed. To change the text being parsed, modify this value. E.g. to add the phrase "The mighty oracle gives forth this proclamation: " to the front of the text being parsed, you would use the following code:
$text = "The mighty oracle gives forth this proclamation: " . $text;
If you are just adding things to the start/end of a page's body and don't need it to actually be integrated into the parsing process you should consider using a separate hook to add/prepend that content instead.