Manual:Hooks/ApiQuery::moduleManager

From Linux Web Expert

ApiQuery::moduleManager
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 190140)</tvar></translate>
Called when ApiQuery has finished initializing its module manager
<translate> Define function:</translate>
public static function onApiQuery_moduleManager( ApiModuleManager $moduleManager ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"ApiQuery::moduleManager": "MediaWiki\\Extension\\MyExtension\\Hooks::onApiQuerymoduleManager"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> api/ApiQuery.php
<translate> Interface:</translate> ApiQuery__moduleManagerHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:ApiQuery::moduleManager extensions</tvar>.</translate>


Can be used to conditionally register API query modules.

Details

  • $moduleManager: ApiModuleManager instance