Manual:Hooks/LinksUpdate

From mediawiki.org
< Manual:Hooks(Redirected from LinksUpdate)
Jump to navigation Jump to search
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": "MyExtensionHooks::onLinksUpdate"
	}
}
Called from:File(s): LinksUpdate.php
Function(s): 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]