Manual:Hooks/APIGetAllowedParams

From Linux Web Expert

APIGetAllowedParams
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Use this hook to modify an API module's parameters
<translate> Define function:</translate>
public static function onAPIGetAllowedParams( ApiBase $module, array &$params, int $flags ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"APIGetAllowedParams": "MediaWiki\\Extension\\MyExtension\\Hooks::onAPIGetAllowedParams"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> api/ApiBase.php
<translate> Interface:</translate> APIGetAllowedParamsHook.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:APIGetAllowedParams extensions</tvar>.</translate>


Details

  • $module: ApiBase object
  • $params: Array of parameters
  • $flags: int zero or OR-ed flags like ApiBase::GET_VALUES_FOR_HELP