MediaWiki master
MediaWiki\User\Options\Hook\ConditionalDefaultOptionsAddConditionHook Interface Reference

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

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onConditionalDefaultOptionsAddCondition (array &$extraConditions)
 This hook is called when ConditionalDefaultsLookup service is created.
 

Detailed Description

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

Use the hook name "ConditionalDefaultOptionsAddCondition" to register handlers implementing this interface. It runs virtually on any request, although it should run once, performance of the hook run should be taken in account.

Stability: stable
to implement

Definition at line 14 of file ConditionalDefaultOptionsAddConditionHook.php.

Member Function Documentation

◆ onConditionalDefaultOptionsAddCondition()

MediaWiki\User\Options\Hook\ConditionalDefaultOptionsAddConditionHook::onConditionalDefaultOptionsAddCondition ( array & $extraConditions)

This hook is called when ConditionalDefaultsLookup service is created.

Important: $extraConditions must be added and used in a property defined by the same extension. Using a condition from a missing extension will result in fatal error. See also Manual:$wgConditionalUserOptions.

Since
1.43
Parameters
array<string,callable>&$extraConditions An empty array to add checker functions to evaluate conditions set in $wgConditionalUserOptions. The key is the name of the condition and the value a callable which will take two arguments:
  • UserIdentity $user: the user which option is being evaluated
  • array $args: the rest of arguments in the relevant condition configuration
Returns
void This hook must not abort, it must return no value

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