Fixed API products when save multiple images from the media library, closes #6792

This commit is contained in:
Claudio Sanches 2014-12-10 15:23:36 -02:00
parent fd15ac4c64
commit a5d70fa24c
1 changed files with 4 additions and 2 deletions

View File

@ -1604,9 +1604,11 @@ class WC_API_Products extends WC_API_Resource {
if ( is_wp_error( $upload ) ) {
return new WP_Error( 'woocommerce_api_cannot_upload_product_image', $upload->get_error_message(), array( 'status' => 400 ) );
}
}
$gallery[] = $this->set_product_image_as_attachment( $upload, $id );
$gallery[] = $this->set_product_image_as_attachment( $upload, $id );
} else {
$gallery[] = $attachment_id;
}
}
}