Automattic\WooCommerce\Blueprint\ResourceStorages
LocalPluginResourceStorage::download
Local plugins are already included (downloaded) in the zip file. Return the full path.
Метод класса: LocalPluginResourceStorage{}
Хуков нет.
Возвращает
Строку|null.
Использование
$LocalPluginResourceStorage = new LocalPluginResourceStorage(); $LocalPluginResourceStorage->download( $slug ): ?string;
- $slug(строка) (обязательный)
- The slug of the plugin to be downloaded.
Код LocalPluginResourceStorage::download() LocalPluginResourceStorage::download WC 10.8.1
public function download( $slug ): ?string {
foreach ( $this->paths as $path ) {
$full_path = $path . "/{$this->suffix}/" . $slug . '.zip';
if ( is_file( $full_path ) ) {
return $full_path;
}
}
return null;
}