Automattic\WooCommerce\Blueprint\ResourceStorages
OrgPluginResourceStorage::download
Download the plugin from wordpress.org
Method of the class: OrgPluginResourceStorage{}
No Hooks.
Returns
String|false
. The path to the downloaded plugin file, or false on failure.
Usage
$OrgPluginResourceStorage = new OrgPluginResourceStorage(); $OrgPluginResourceStorage->download( $slug ): ?string;
- $slug(string) (required)
- The slug of the plugin to be downloaded.
OrgPluginResourceStorage::download() OrgPluginResourceStorage::download code WC 9.9.5
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; }