WC_Product::get_file PHP Method

get_file() public method

Get a file by $download_id.
public get_file ( string $download_id = '' ) : array | false
$download_id string file identifier
return array | false if not found
    public function get_file($download_id = '')
    {
        $files = $this->get_downloads();
        if ('' === $download_id) {
            $file = sizeof($files) ? current($files) : false;
        } elseif (isset($files[$download_id])) {
            $file = $files[$download_id];
        } else {
            $file = false;
        }
        return apply_filters('woocommerce_product_file', $file, $this, $download_id);
    }
WC_Product