undefined index when product image gallery side meta box is removed fixes 6855

This commit is contained in:
splashingpixels 2014-11-27 20:42:58 -08:00
parent b6cd6b8735
commit 13ad1100c5
1 changed files with 1 additions and 1 deletions

View File

@ -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 ) );
}