Manual:Hooks/LinksUpdate

From mediawiki.org
LinksUpdate
Available from version 1.12.0
At the beginning of LinksUpdate::doUpdate() just before the actual update
Define function:
public static function onLinksUpdate( &$linksUpdate ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"LinksUpdate": "MediaWiki\\Extension\\MyExtension\\Hooks::onLinksUpdate"
	}
}
Called from: File(s): deferred/LinksUpdate/LinksUpdate.php
Function(s): MediaWiki\Deferred\LinksUpdate\LinksUpdate::doUpdate()
Interface: LinksUpdateHook.php

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

Details[edit]

  • &$linksUpdate: the LinksUpdate object

LinksUpdate is called when a page has new content that needs to be processed for links (or, more generally, metadata), whether it got created, edited or restored. When a page is moved, the hook is called for both the old and new version of the page [1].

See also[edit]