diff --git a/includes/admin/meta-boxes/class-wc-meta-box-product-images.php b/includes/admin/meta-boxes/class-wc-meta-box-product-images.php index 2b856a7ff40..6a7f4b9e78d 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-product-images.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-product-images.php @@ -64,7 +64,7 @@ class WC_Meta_Box_Product_Images { * Save meta box data */ public static function save( $post_id, $post ) { - $attachment_ids = array_filter( explode( ',', wc_clean( $_POST['product_image_gallery'] ) ) ); + $attachment_ids = isset( $_POST['product_image_gallery'] ) ? array_filter( explode( ',', wc_clean( $_POST['product_image_gallery'] ) ) ) : array(); update_post_meta( $post_id, '_product_image_gallery', implode( ',', $attachment_ids ) ); }