Manual:Hooks/EditPageGetPreviewContent

From MediaWiki.org
Jump to: navigation, search
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:
$wgHooks['EditPageGetPreviewContent'][] = 'MyExtensionHooks::onEditPageGetPreviewContent';
Called from: File(s): EditPage.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)