Manual:Hooks/ArticleEditUpdates

From MediaWiki.org
Jump to navigation Jump to search
ArticleEditUpdates
Available from version 1.14.0
Executes when edit updates (mainly link tracking) are made after an article has been changed
Define function:
public static function onArticleEditUpdates( WikiPage &$wikiPage, \MediaWiki\Edit\PreparedEdit &$editInfo, bool $changed ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ArticleEditUpdates": "MyExtensionHooks::onArticleEditUpdates"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ArticleEditUpdates'][] = 'MyExtensionHooks::onArticleEditUpdates';
Called from:File(s): Storage/DerivedPageDataUpdater.php
Function(s): doUpdates

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

Details[edit]

  • &$wikiPage: WikiPage object 1.18+
  • &$editInfo: MediaWiki\Edit\PreparedEdit object, data holder that includes the parser output for the page being changed
  • $changed: flag indicating that page was changed (boolean)