Manual:Hooks/WikiPageDeletionUpdates
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate>
This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version <tvar name=ver>1.32.0</tvar>.</translate> <translate> Please see <tvar name=page>PageDeletionDataUpdates</tvar> for an alternative way to use this feature.</translate> |
WikiPageDeletionUpdates | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate> manipulate the list of DeferrableUpdate s 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.