Manual:Hooks/LinksUpdate

Category:MediaWiki hooks#LinksUpdate Category:Hooks added in MediaWiki 1.12.0#LinksUpdate
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.phpCategory:MediaWiki hooks included in LinksUpdate.php#LinksUpdate
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

  • &$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 .

See also

Category:Hooks added in MediaWiki 1.12.0 Category:MediaWiki hooks Category:MediaWiki hooks included in LinksUpdate.php