Open main menu


Available from version 1.25.0 (Gerrit change 187986)
Removed in version 1.31.0
Allows to add context-based Less variables.
Define function:
public static function onResourceLoaderGetLessVars( array &$lessVars ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"ResourceLoaderGetLessVars": "MyExtensionHooks::onResourceLoaderGetLessVars"

For MediaWiki ≤1.25:

$wgHooks['ResourceLoaderGetLessVars'][] = 'MyExtensionHooks::onResourceLoaderGetLessVars';
Called from:File(s): resourceloader/ResourceLoader.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ResourceLoaderGetLessVars extensions.


  • &$lessVars: An array of already added variables, which can be extended