Manual:Hooks/BeforeParserFetchTemplateAndtitle
(Redirected from Manual:Hooks/BeforeParserFetchTemplateAndTitle)
This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version 1.36.0. Please see BeforeParserFetchTemplateRevisionRecord for an alternative way to use this feature. |
BeforeParserFetchTemplateAndtitle | |
---|---|
Available from version 1.10.1 Allows an extension to specify a version of a page to get for inclusion in a template | |
Define function: | public static function onBeforeParserFetchTemplateAndtitle( Parser $parser, $title, &$skip, &$id ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"BeforeParserFetchTemplateAndtitle": "MyExtensionHooks::onBeforeParserFetchTemplateAndtitle"
}
}
|
Called from: | File(s): parser/Parser.php |
Interface: | BeforeParserFetchTemplateAndtitleHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:BeforeParserFetchTemplateAndtitle extensions.
ParametersEdit
- $parser: Parser object, used to pass the context of the page whose parsing is calling this hook
- $title: Title object, used to pass the page to be transcluded
- &$skip: Defaults to false, which lets the transclusion continue; if set to true, will replace the transclusion with a simple wiki link to the title
- &$id: Defaults to false, which will cause the most recent revision to be fetched; if set to a revision ID, will fetch that revision instead