MediaWiki REL1_39
MediaWiki\Hook\BeforeParserFetchTemplateRevisionRecordHook Interface Reference
Inheritance diagram for MediaWiki\Hook\BeforeParserFetchTemplateRevisionRecordHook:

Public Member Functions

 onBeforeParserFetchTemplateRevisionRecord (?LinkTarget $contextTitle, LinkTarget $title, bool &$skip, ?RevisionRecord &$revRecord)
 This hook is called before a template is fetched by Parser.
 

Detailed Description

Stability: stable
to implement

Definition at line 12 of file BeforeParserFetchTemplateRevisionRecordHook.php.

Member Function Documentation

◆ onBeforeParserFetchTemplateRevisionRecord()

MediaWiki\Hook\BeforeParserFetchTemplateRevisionRecordHook::onBeforeParserFetchTemplateRevisionRecord ( ?LinkTarget $contextTitle,
LinkTarget $title,
bool & $skip,
?RevisionRecord & $revRecord )

This hook is called before a template is fetched by Parser.

It allows redirection of the title and/or revision id of the template. For example: the template could be redirected to an appropriately localized version of the template; or the template fetch could be redirected to a 'stable revision' of the template. If the returned RevisionRecord does not exist, its title will be added to the page dependencies and then this hook will be invoked again to resolve that title. This allows for fallback chains (of limited length).

Since
1.36
Parameters
?LinkTarget$contextTitleThe top-level page title, if any
LinkTarget$titleThe template link (from the literal wikitext)
bool&$skipSkip this template and link it?
?RevisionRecord&$revRecordThe desired revision record
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: