Manual:Hooks/ParserFirstCallInit/de-formal

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
ParserFirstCallInit
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
called when the parser initializes for the first time
<translate> Define function:</translate>
public static function onParserFirstCallInit( Parser $parser ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"ParserFirstCallInit": "MediaWiki\\Extension\\MyExtension\\Hooks::onParserFirstCallInit"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> parser/Parser.php
<translate> Function(s):</translate> __construct
<translate> Interface:</translate> ParserFirstCallInitHook.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:ParserFirstCallInit extensions/de-formal</tvar>.</translate>

Details

  • Parser $parser: Parser object being initialized

Examples

For examples on how this hook should be used, please see:

Phabricator

  • phab:T299528 - Deprecate and remove ParserFirstCallInit hook (move hook/tag registration out of Parser constructor)

See also