From 916f3709a7fac36f5f5e845f5e0efc5479e4a261 Mon Sep 17 00:00:00 2001 From: Hoang Huu Date: Wed, 2 Oct 2019 14:29:39 +0700 Subject: [PATCH] Update API --- inc/api/v1/property.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/api/v1/property.php b/inc/api/v1/property.php index f49a03f5..3a5ddf0a 100644 --- a/inc/api/v1/property.php +++ b/inc/api/v1/property.php @@ -270,7 +270,8 @@ class Property_Api extends Base_Api { $data = opalesetate_property( $property_info->ID ); $gallery = $data->get_gallery(); - $property['info']['gallery'] = isset( $gallery[0] ) && ! empty( $gallery[0] ) ? $gallery[0] : []; + $gallery_count = $data->get_gallery_count(); + $property['info']['gallery'] = $gallery_count ? $gallery : []; $property['info']['price'] = opalestate_price_format( $data->get_price() ); $property['info']['map'] = $data->get_map(); $property['info']['address'] = $data->get_address();