www.fgks.org   »   [go: up one dir, main page]

Jump to content

Manual:Hooks/CustomEditor

From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
CustomEditor
Available from version 1.9.1
When invoking the page editor. Return true to allow the normal editor to be used, or false if implementing a custom editor, e.g. for a special namespace, etc.
Define function:
public static function onCustomEditor( Page $page, User $user ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"CustomEditor": "MediaWiki\\Extension\\MyExtension\\Hooks::onCustomEditor"
	}
}
Called from: File(s): actions/EditAction.php
Interface: CustomEditorHook.php

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

Details

  • $page - Page being edited
  • $user - User performing the edit