Manual:Hooks/EditPageGetCheckboxesDefinition

From Linux Web Expert

EditPageGetCheckboxesDefinition
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Allows modifying the edit checkboxes in the edit form
<translate> Define function:</translate>
public static function onEditPageGetCheckboxesDefinition( EditPage $editPage, array &$checkboxes ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"EditPageGetCheckboxesDefinition": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditPageGetCheckboxesDefinition"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> EditPage.php
<translate> Interface:</translate> EditPageGetCheckboxesDefinitionHook.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:EditPageGetCheckboxesDefinition extensions</tvar>.</translate>


Details

  • $editPage: The current EditPage object
  • &$checkboxes: Array of checkbox definitions. See EditPage::getCheckboxesDefinition() for the format.

MW 1.35+ This hook allows non-checkbox widgets to be added to the edit form.