Manual:Hooks/ImportSources

From MediaWiki.org
Jump to navigation Jump to search
ImportSources
Available from version 1.27.0 (Gerrit change 230996)
Called when reading from the $wgImportSources configuration variable
Define function:
public static function onImportSources( array &$importSources ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ImportSources": "MyExtensionHooks::onImportSources"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ImportSources'][] = 'MyExtensionHooks::onImportSources';
Called from:File(s): api/ApiImport.php, specials/SpecialImport.php
Function(s): getAllowedImportSources, execute

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

Can be used to lazy-load the import sources list.

Details[edit]