Hotfix single property settings

This commit is contained in:
Hoang Huu
2020-02-15 10:13:54 +07:00
parent 7a4f3b67dc
commit 0c1b3b7ef1
4 changed files with 14 additions and 8 deletions

View File

@@ -134,7 +134,7 @@ class Opalestate_Property {
public function get_block_setting( $key ) {
if ( ! $this->property_settings ) {
$keys = [
$key_settings = [
'amenities',
'attachments',
'facilities',
@@ -151,12 +151,12 @@ class Opalestate_Property {
'mortgage',
];
foreach ( $keys as $key ) {
$this->property_settings[ $key ] = opalestate_get_option( 'enable_single_' . $key, 'on' );
foreach ( $key_settings as $key_setting ) {
$this->property_settings[ $key_setting ] = opalestate_get_option( 'enable_single_' . $key_setting, 'on' );
}
}
return $this->property_settings[ $key ];
return isset( $this->property_settings[ $key ] ) ? $this->property_settings[ $key ] : null;
}
/**