Manual:Hooks/ApiBeforeMain

Category:MediaWiki hooks#ApiBeforeMain Category:Hooks added in MediaWiki 1.23.0#ApiBeforeMain
ApiBeforeMain
Available from version 1.23.0 (Gerrit change 100996)
Occurs before ApiMain's execute is called to process the request.
Define function:
public static function onApiBeforeMain( &$main ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ApiBeforeMain": "MediaWiki\\Extension\\MyExtension\\Hooks::onApiBeforeMain"
	}
}
Called from: File(s): ../api.phpCategory:MediaWiki hooks included in api.php#ApiBeforeMain
Interface: ApiBeforeMainHook.php

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

Details

  • &$main: ApiMain being used for request

See also

Category:Hooks added in MediaWiki 1.23.0 Category:MediaWiki hooks Category:MediaWiki hooks included in api.php