WordPress at Your Fingertips
function is not described

WC_Download_Handler::check_download_expiry() private WC 1.0

Check if the download has expired.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Download_Handler::check_download_expiry( $download );
$download(WC_Customer_Download) (required)
Download instance.

Code of WC_Download_Handler::check_download_expiry() WC 5.7.1

private static function check_download_expiry( $download ) {
	if ( ! is_null( $download->get_access_expires() ) && $download->get_access_expires()->getTimestamp() < strtotime( 'midnight', time() ) ) {
		self::download_error( __( 'Sorry, this download has expired', 'woocommerce' ), '', 403 );
	}
}