Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Download_Handler::check_order_is_valid( WC_Customer_Download $download )
Check if an order is valid for downloading from.
Description Description
Parameters Parameters
- $download
-
(Required) Download instance.
Source Source
File: includes/class-wc-download-handler.php
private static function check_order_is_valid( $download ) { if ( $download->get_order_id() ) { $order = wc_get_order( $download->get_order_id() ); if ( $order && ! $order->is_download_permitted() ) { self::download_error( __( 'Invalid order.', 'woocommerce' ), '', 403 ); } } }