Manual:Hooks/EditPageGetPreviewContent

From mediawiki.org
EditPageGetPreviewContent
Available from version 1.21.0
Allow modifying the wikitext that will be previewed. Note that it is preferable to implement previews for different data types using the ContentHandler facility.
Define function:
public static function onEditPageGetPreviewContent( $editPage, &$content ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"EditPageGetPreviewContent": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditPageGetPreviewContent"
	}
}
Called from: File(s): EditPage.php
Interface: EditPageGetPreviewContentHook.php

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


Details[edit]

  • $editPage: The EditPage object
  • &content: Content object to be previewed (may be replaced by hook function)