Manual:Hooks/ArticleUndelete

From MediaWiki.org
Jump to: navigation, search
ArticleUndelete
Available from version 1.9.1
When one or more revisions of an article are restored
Define function:
public static function onArticleUndelete( Title $title, $create, $comment, $oldPageId, $restoredPages ) { ... }
Attach hook:
$wgHooks['ArticleUndelete'][] = 'MyExtensionHooks::onArticleUndelete';
Called from: File(s): SpecialUndelete.php

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

Details[edit]

  • $title: Title corresponding to the article restored
  • $create: Whether or not the restoration caused the page to be created (i.e. it didn't exist before)
  • $comment: Comment explaining the undeletion
  • $oldPageId: ID of page previously deleted (from archive table). This ID will be used for the restored page. (since gerrit:133631)
  • $restoredPages: Set of page IDs that have revisions restored for the undelete, with keys being page IDs and values are 'true'. (since gerrit: 281078)