< Manual:Hooks
ContentAlterParserOutput | |
---|---|
Available from version 1.25.0 (Gerrit change 161471) Customize parser output for a given content object, called by AbstractContent::getParserOutput . | |
Define function: | public static function onContentAlterParserOutput( Content $content, Title $title, ParserOutput &$output ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"ContentAlterParserOutput": "MyExtensionHooks::onContentAlterParserOutput"
}
}
|
Called from: | File(s): content/AbstractContent.php Function(s): getParserOutput |
Interface: | ContentAlterParserOutputHook.php |
For more information about attaching hooks, see Manual:Hooks
For examples of extensions using this hook, see Category:ContentAlterParserOutput extensions.
Details
Modifies the parser output for a given content object. Called by Content::getParserOutput
after parsing has finished. Can be used for changes that depend on the result of the parsing but have to be done before LinksUpdate is called (such as adding tracking categories based on the rendered HTML).
- $content
- The Content to render
- $title
- Title of the page, as context
- $parserOutput
- ParserOutput to manipulate
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.