WC_Product::get_file( string $download_id = '' )
Get a file by $download_id.
Description Description
Parameters Parameters
- $download_id
-
(Optional) file identifier.
Default value: ''
Return Return
(array|false) if not found
Source Source
File: includes/abstracts/abstract-wc-product.php
public function get_file( $download_id = '' ) { $files = $this->get_downloads(); if ( '' === $download_id ) { $file = count( $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 ); }