Manual:Hooks/EditPageBeforeEditButtons

From Linux Web Expert

EditPageBeforeEditButtons
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Used to modify the edit buttons on the edit form
<translate> Define function:</translate>
public static function onEditPageBeforeEditButtons( &$editpage, &$buttons, &$tabindex ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"EditPageBeforeEditButtons": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditPageBeforeEditButtons"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> EditPage.php
<translate> Interface:</translate> EditPageBeforeEditButtonsHook.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:EditPageBeforeEditButtons extensions</tvar>.</translate>

Details

  • $editpage: the current EditPage object
  • $buttons: the edit buttons found below the editing box ("Save", "Preview" and "Diff")
  • $tabindex: HTML tabindex of the last edit check/button