Manual:Hooks/ImportHandleToplevelXMLTag

From MediaWiki.org
Jump to navigation Jump to search
ImportHandleToplevelXMLTag
Available from version 1.17.0
When parsing a top level XML tag.
Define function:
public static function onImportHandleToplevelXMLTag( $importer ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ImportHandleToplevelXMLTag": "MyExtensionHooks::onImportHandleToplevelXMLTag"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ImportHandleToplevelXMLTag'][] = 'MyExtensionHooks::onImportHandleToplevelXMLTag';
Called from:File(s): import/WikiImporter.php

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

Details[edit]

  • $importer: WikiImporter object

Return false to stop further processing of the tag