Manual:Hooks/APIHelpModifyOutput

From MediaWiki.org
Jump to navigation Jump to search
APIHelpModifyOutput
Available from version 1.25.0 (Gerrit change 160798)
Allows to modify an API module's help output
Define function:
public static function onAPIHelpModifyOutput( ApiBase $module, array &$help, array $options, array &$toc ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"APIHelpModifyOutput": "MyExtensionHooks::onAPIHelpModifyOutput"
	}
}

For MediaWiki ≤1.25:

$wgHooks['APIHelpModifyOutput'][] = 'MyExtensionHooks::onAPIHelpModifyOutput';
Called from:File(s): api/ApiHelp.php
Function(s): getHelpInternal

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

Details[edit]

  • $module - ApiBase object
  • &$help - Array of HTML strings to be joined for the output
  • $options - Array of options passed to ApiBase::getHelp()
  • &$toc - If a TOC is being generated, this array has keys as anchors in the page and values as for Linker::generateTOC().