Manual:Hooks/WikiPageDeletionUpdates

From Linux Web Expert

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.
WikiPageDeletionUpdates
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
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.
<translate> Define function:</translate>
public static function onWikiPageDeletionUpdates( WikiPage $page, Content $content = null, array &$updates ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"WikiPageDeletionUpdates": "MediaWiki\\Extension\\MyExtension\\Hooks::onWikiPageDeletionUpdates"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> page/WikiPage.php
<translate> Interface:</translate> WikiPageDeletionUpdatesHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:WikiPageDeletionUpdates extensions</tvar>.</translate>


Details

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