From 144606f1fb0e5aed031e4853a86622175948be76 Mon Sep 17 00:00:00 2001 From: Matt Sherman Date: Mon, 31 Jul 2023 19:10:36 -0400 Subject: [PATCH] Check if product_type query arg is set before using --- plugins/woocommerce/includes/class-wc-ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/class-wc-ajax.php b/plugins/woocommerce/includes/class-wc-ajax.php index e0edbc3a84d..68c31da3982 100644 --- a/plugins/woocommerce/includes/class-wc-ajax.php +++ b/plugins/woocommerce/includes/class-wc-ajax.php @@ -611,7 +611,7 @@ class WC_AJAX { wp_die( -1 ); } - $product_type = sanitize_text_field( wp_unslash( $_POST['product_type'] ) ); + $product_type = isset( $_POST['product_type'] ) ? sanitize_text_field( wp_unslash( $_POST['product_type'] ) ) : 'simple'; $i = absint( $_POST['i'] ); $metabox_class = array();