error handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
trav 2024-07-09 14:12:14 -04:00
parent dfdf13cf6f
commit cd14c04689

View File

@ -189,6 +189,16 @@ if(!is_user_logged_in()){
$product_name = $coffee->post_title; $product_name = $coffee->post_title;
$roast = get_field("roast_level", $coffee->ID); $roast = get_field("roast_level", $coffee->ID);
$is_organic = get_field("is_organic", $coffee->ID); $is_organic = get_field("is_organic", $coffee->ID);
if (is_object($coffee)) {
$product_name = $coffee->post_title;
$roast = get_field("roast_level", $coffee->ID);
$is_organic = get_field("is_organic", $coffee->ID);
} else {
// Handle the case where $coffee is not an object
error_log("Error: \$coffee is not an object in template-order-label.php");
// Set default values or skip this iteration
}
} ?> } ?>
<div class="label"> <div class="label">
<div> <div>