Jump to content

Manual:Hooks/ResourceLoaderJqueryMsgModuleMagicWords

From mediawiki.org
ResourceLoaderJqueryMsgModuleMagicWords
Available from version 1.29.0 (Gerrit change 344079)
Called in ResourceLoaderJqueryMsgModule to allow adding magic words for jQueryMsg. The key is an all-caps magic word, and the value is a string; values depend only on the ResourceLoaderContext
Define function:
public static function onResourceLoaderJqueryMsgModuleMagicWords( ResourceLoaderContext $context, array &$magicWords ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ResourceLoaderJqueryMsgModuleMagicWords": "MediaWiki\\Extension\\MyExtension\\Hooks::onResourceLoaderJqueryMsgModuleMagicWords"
	}
}
Called from: File(s): ../resources/Resources.php
Function(s): ResourceLoaderJqueryMsgModule::getScript
Interface: ResourceLoaderJqueryMsgModuleMagicWordsHook.php

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


Details

[edit]
  • $context: ResourceLoaderContext object
  • &$magicWords: Array of magic words to add to, mapping all-caps magic words to string values based on the context