undefined index when product image gallery side meta box is removed fixes 6855
This commit is contained in:
parent
b6cd6b8735
commit
13ad1100c5
|
@ -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 ) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue