Manual:Hooks/EditPageGetPreviewContent
Appearance
| 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/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)