From b57223d4764ba515fc4bb7b71a7343fe95458e43 Mon Sep 17 00:00:00 2001 From: "j.ostrowka" Date: Mon, 18 Nov 2024 10:17:02 +0100 Subject: [PATCH] pb-1295 --- includes/cart/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/cart/functions.php b/includes/cart/functions.php index 7b0bd263e63..56bb5c8dc4b 100644 --- a/includes/cart/functions.php +++ b/includes/cart/functions.php @@ -135,7 +135,7 @@ function edd_get_cart_quantity() { function edd_add_to_cart( $download_id, $options = array() ) { $download = get_post( $download_id ); - if( 'download' != $download->post_type ) + if( 'download' != ($download->post_type ?? null) ) return; // Not a download product if ( ! current_user_can( 'edit_post', $download->ID ) && $download->post_status != 'publish' ) {