Remove featured image on empty image array
This commit is contained in:
parent
845b7a570e
commit
8c523ee0b9
|
@ -1033,7 +1033,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
||||||
* @return WC_Product
|
* @return WC_Product
|
||||||
*/
|
*/
|
||||||
protected function set_product_images( $product, $images ) {
|
protected function set_product_images( $product, $images ) {
|
||||||
if ( is_array( $images ) ) {
|
if ( is_array( $images ) && ! empty( $images ) ) {
|
||||||
$gallery = array();
|
$gallery = array();
|
||||||
|
|
||||||
foreach ( $images as $image ) {
|
foreach ( $images as $image ) {
|
||||||
|
|
Loading…
Reference in New Issue