Remove featured image on empty image array

This commit is contained in:
claudiulodro 2017-09-01 11:14:48 -07:00
parent 845b7a570e
commit 8c523ee0b9
1 changed files with 1 additions and 1 deletions

View File

@ -1033,7 +1033,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
* @return WC_Product
*/
protected function set_product_images( $product, $images ) {
if ( is_array( $images ) ) {
if ( is_array( $images ) && ! empty( $images ) ) {
$gallery = array();
foreach ( $images as $image ) {