Manual:Hooks/GetAllBlockActions
GetAllBlockActions | |
---|---|
Available from version 1.37.0 (Gerrit change 681005) Add an action that can be blocked via a partial block. | |
Define function: | public static function onGetAllBlockActions( array &$actions ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"GetAllBlockActions": "MediaWiki\\Extension\\MyExtension\\Hooks::onGetAllBlockActions"
}
}
|
Called from: | File(s): block/BlockActionInfo.php Function(s): getAllBlockActions |
Interface: | GetAllBlockActionsHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:GetAllBlockActions extensions.
The action should be added to the $action
array. The key should be the name of the action as it appears in the code, and the value should be a unique integer ID.
IDs for extension actions must be 100 or greater and must not conflict with other extensions' IDs. IDs must be documented here in order to ensure no conflicts:
ID | Extension | Action name |
---|---|---|
100 | Thanks | thanks
|
150 | CreateWiki | requestwiki
|
200 | ImportDump | request-import
|
In the future ID conflicts may instead be handled by MediaWiki (see task T280808).
Details
edit&$actions
: array of action names to unique IDs