Jump to content

Manual:Hooks/WikiPageDeletionUpdates

From mediawiki.org
WikiPageDeletionUpdates
Available from version 1.21.0
manipulate the list of DeferrableUpdates to be applied when a page is deleted. Called in WikiPage::getDeletionUpdates(). Note that updates specific to a content model should be provided by the respective Content's getDeletionUpdates() method.
Define function:
public static function onWikiPageDeletionUpdates( WikiPage $page, Content $content = null, array &$updates ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"WikiPageDeletionUpdates": "MediaWiki\\Extension\\MyExtension\\Hooks::onWikiPageDeletionUpdates"
	}
}
Called from: File(s): page/WikiPage.php
Interface: WikiPageDeletionUpdatesHook.php

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


Details

[edit]
  • $page: the WikiPage
  • $content: the Content to generate updates for, or null in case the page revision could not be loaded. The delete will succeed despite this.
  • &$updates: the array of objects that implement DeferrableUpdate. Hook function may want to add to it.