Manual:Hooks/EditPageGetPreviewText

From MediaWiki.org
Jump to: navigation, search
EditPageGetPreviewText
Available from version 1.16.0
Removed in version 1.29.0
Allow modifying the wikitext that will be previewed
Define function:
public static function onEditPageGetPreviewText( $editPage, &$toparse ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"EditPageGetPreviewText": "MyExtensionHooks::onEditPageGetPreviewText"
	}
}

For MediaWiki ≤1.25:

$wgHooks['EditPageGetPreviewText'][] = 'MyExtensionHooks::onEditPageGetPreviewText';
Called from: File(s): EditPage.php

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

Details[edit]

  • $editPage: The EditPage object
  • &$toparse: wikitext that will be parsed