From 89b2eeb2d11fa5e507f10fc23793c56c60768957 Mon Sep 17 00:00:00 2001 From: Hoang Huu Date: Sat, 28 Sep 2019 15:00:45 +0700 Subject: [PATCH] Update class-opalestate-property.php --- inc/property/class-opalestate-property.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/property/class-opalestate-property.php b/inc/property/class-opalestate-property.php index 5914dd3f..e5e40655 100755 --- a/inc/property/class-opalestate-property.php +++ b/inc/property/class-opalestate-property.php @@ -571,11 +571,15 @@ class Opalestate_Property { return $this->get_metabox_value( 'gallery', true ); } - + /** + * Count gallery images. + * + * @return int + */ public function get_gallery_count() { $count = $this->get_gallery(); - return count( $count ); + return is_array( $count ) && $count ? count( $count ) : 0; } /**