Manual:Hooks/AfterImportPage

From MediaWiki.org
Jump to: navigation, search
AfterImportPage
Available from version 1.17.0
When a page import is completed
Define function:
public static function onAfterImportPage( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"AfterImportPage": [
			"MyExtensionHooks::onAfterImportPage"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['AfterImportPage'][] = 'MyExtensionHooks::onAfterImportPage';
Called from: File(s): Import.php

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

Details[edit]

  • $title: Title under which the revisions were imported
  • $origTitle: Title provided by the XML file
  • $revCount: Number of revisions in the XML file
  • $sRevCount: Number of sucessfully imported revisions
  • $pageInfo: associative array of page information