WordPress at Your Fingertips
function is not described

WC_Product_Download::file_exists() public WC 1.0

Validate file exists.

{} It's a method of the class: WC_Product_Download{}

Hooks from the method
Return

true|false.

Usage

$WC_Product_Download = new WC_Product_Download();
$WC_Product_Download->file_exists();

Code of WC_Product_Download::file_exists() WC 5.7.1

public function file_exists() {
	if ( 'relative' !== $this->get_type_of_file_path() ) {
		return true;
	}
	$file_url = $this->get_file();
	if ( '..' === substr( $file_url, 0, 2 ) || '/' !== substr( $file_url, 0, 1 ) ) {
		$file_url = realpath( ABSPATH . $file_url );
	} elseif ( substr( WP_CONTENT_DIR, strlen( untrailingslashit( ABSPATH ) ) ) === substr( $file_url, 0, strlen( substr( WP_CONTENT_DIR, strlen( untrailingslashit( ABSPATH ) ) ) ) ) ) {
		$file_url = realpath( WP_CONTENT_DIR . substr( $file_url, 11 ) );
	}
	return apply_filters( 'woocommerce_downloadable_file_exists', file_exists( $file_url ), $this->get_file() );
}