Manual:Hooks/PageUndeleteComplete

From Linux Web Expert

PageUndeleteComplete
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Occurs after the undelete page request has been processed
<translate> Define function:</translate>
public static function onPageUndeleteComplete( 
	MediaWiki\Page\ProperPageIdentity $page,
	MediaWiki\Permissions\Authority $restorer,
	string $reason,
	MediaWiki\Revision\RevisionRecord $restoredRev,
	ManualLogEntry $logEntry,
	int $restoredRevisionCount,
	bool $created,
	array $restoredPageIds
 ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"PageUndeleteComplete": "MediaWiki\\Extension\\MyExtension\\Hooks::onPageUndeleteComplete"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> page/UndeletePage.php
<translate> Interface:</translate> PageUndeleteCompleteHook.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:PageUndeleteComplete extensions</tvar>.</translate>

Details

  • $page: page that was undeleted.
  • $restorer: who undeleted the page
  • $reason: reason the page was undeleted
  • $restoredRev: last revision of the undeleted page
  • $logEntry: log entry generated by the restoration
  • $restoredRevisionCount: number of revisions restored during the deletion
  • $created: whether the undeletion result in a page being created
  • $restoredPageIds: array of all undeleted page IDs. This will have multiple page IDs if there was more than one deleted page with the same page title.

See also