MediaWiki REL1_40
MediaWiki\Hook\ParserOptionsRegisterHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onParserOptionsRegister (&$defaults, &$inCacheKey, &$lazyLoad)
 Use this hook to register additional parser options.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ParserOptionsRegister" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 12 of file ParserOptionsRegisterHook.php.

Member Function Documentation

◆ onParserOptionsRegister()

MediaWiki\Hook\ParserOptionsRegisterHook::onParserOptionsRegister ( & $defaults,
& $inCacheKey,
& $lazyLoad )

Use this hook to register additional parser options.

Note that if you change the default value for an option, all existing parser cache entries will be invalid. To avoid bugs, you'll need to handle that somehow (e.g. with the RejectParserCacheValue hook) because MediaWiki won't do it for you.

Since
1.35
Parameters
array&$defaultsSet the default value for your option here
array&$inCacheKeyTo fragment the parser cache on your option, set a truthy value in this array, with the key being the option name.
array&$lazyLoadTo lazy-initialize your option, set it null in $defaults and set a callable in this array, with the key being the option name. The callable is passed the ParserOptions object and the option name.
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: