Automattic\WooCommerce\Blueprint\ResourceStorages
OrgPluginResourceStorage::download
Download the plugin from wordpress.org
Метод класса: OrgPluginResourceStorage{}
Хуков нет.
Возвращает
string|false. The path to the downloaded plugin file, or false on failure.
Использование
$OrgPluginResourceStorage = new OrgPluginResourceStorage(); $OrgPluginResourceStorage->download( $slug ): ?string;
- $slug(строка) (обязательный)
- The slug of the plugin to be downloaded.
Код OrgPluginResourceStorage::download() OrgPluginResourceStorage::download WC 11.2.2
public function download( $slug ): ?string {
$download_link = $this->get_download_link( $slug );
if ( ! $download_link ) {
return false;
}
$result = $this->download_url( $download_link );
if ( is_wp_error( $result ) ) {
return false;
}
return $result;
}