Manual:Hooks/ImportSources
From Linux Web Expert
ImportSources | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 230996)</tvar></translate> Called when reading from the $wgImportSources configuration variable | |
<translate> Define function:</translate> | public static function onImportSources( array &$importSources ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"ImportSources": "MediaWiki\\Extension\\MyExtension\\Hooks::onImportSources"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> api/ApiImport.php, specials/SpecialImport.php <translate> Function(s):</translate> getAllowedImportSources, execute |
<translate> Interface:</translate> | ImportSourcesHook.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:ImportSources extensions</tvar>.</translate>
Can be used to lazy-load the import sources list.
Details
&$importSources
: The value of$wgImportSources
, must be an array