get_downloads() public method

Get downloads.
Since: 2.7.0
public get_downloads ( string $context = 'view' ) : array
$context string
return array
 /**
  * Get the downloads for a product or product variation
  *
  * @since 2.1
  * @param WC_Product|WC_Product_Variation $product
  * @return array
  */
 private function get_downloads($product)
 {
     $downloads = array();
     if ($product->is_downloadable()) {
         foreach ($product->get_downloads() as $file_id => $file) {
             $downloads[] = array('id' => $file_id, 'name' => $file['name'], 'file' => $file['file']);
         }
     }
     return $downloads;
 }