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.


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