Manual:Hooks/ResourceLoaderForeignApiModules

From MediaWiki.org
Jump to navigation Jump to search
ResourceLoaderForeignApiModules
Available from version 1.26.0 (Gerrit change 231710)
Called from ResourceLoaderForeignApiModule. Use this to add dependencies to 'mediawiki.ForeignApi' module when you wish to override its behavior. See the module docs for more information.
Define function:
public static function onResourceLoaderForeignApiModules( &$dependencies, $context ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ResourceLoaderForeignApiModules": "MyExtensionHooks::onResourceLoaderForeignApiModules"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ResourceLoaderForeignApiModules'][] = 'MyExtensionHooks::onResourceLoaderForeignApiModules';
Called from:File(s): ResourceLoaderForeignApiModule.php
Function(s): getDependencies

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

Details[edit]

  • &$dependencies: string[] List of modules that 'mediawiki.ForeignApi' should depend on
  • $context: ResourceLoaderContext|null