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; } /**