www.fgks.org   »   [go: up one dir, main page]

Jump to content

Manual:Hooks/LinksUpdate

From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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

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