Manual:Hooks/ArticlePrepareTextForEdit

From MediaWiki.org
Jump to navigation Jump to search
ArticlePrepareTextForEdit
Available from version 1.18.0 (r80428)
Called when preparing text to be saved.
Define function:
public static function onArticlePrepareTextForEdit( WikiPage $wikiPage, ParserOptions $parserOptions ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ArticlePrepareTextForEdit": "MyExtensionHooks::onArticlePrepareTextForEdit"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ArticlePrepareTextForEdit'][] = 'MyExtensionHooks::onArticlePrepareTextForEdit';
Called from:File(s): Storage/DerivedPageDataUpdater.php

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

Details[edit]

  • $wikiPage: the WikiPage being saved
  • $parserOptions: parser options to be used for pre-save transformation