Manual:Hooks/EditPageGetPreviewContent

Category:MediaWiki hooks#EditPageGetPreviewContent Category:Hooks added in MediaWiki 1.21.0#EditPageGetPreviewContent
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.phpCategory:MediaWiki hooks included in EditPage.php#EditPageGetPreviewContent
Interface: EditPageGetPreviewContentHook.php

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

Details

  • $editPage: The EditPage object
  • &content: Content object to be previewed (may be replaced by hook function)
Category:Hooks added in MediaWiki 1.21.0 Category:MediaWiki hooks Category:MediaWiki hooks included in EditPage.php