This commit is contained in:
Lieu Le 2019-09-28 17:00:16 +07:00
parent d276e283b5
commit b85f93a574

View File

@ -1169,47 +1169,48 @@ function opalestate_get_property_statuses() {
* @param $key * @param $key
*/ */
function opalestate_get_property_meta_icon( $key ) { function opalestate_get_property_meta_icon( $key ) {
$classes = []; $classes = '';
$classes[] = 'icon-property-' . esc_attr( $key ); $classes .= 'icon-property-' . esc_attr( $key );
$classes[] = 'far';
$prefix = 'fa';
switch ( $key ) { switch ( $key ) {
case 'builtyear': case 'builtyear':
$icon = $prefix . '-' . 'calendar'; $icon = 'fas fa-calendar';
break; break;
case 'parking': case 'parking':
$icon = $prefix . '-' . 'car'; $icon = 'fas fa-car';
break; break;
case 'bedrooms': case 'bedrooms':
$icon = $prefix . '-' . 'bed'; $icon = 'fas fa-bed';
break; break;
case 'bathrooms': case 'bathrooms':
$icon = $prefix . '-' . 'bath'; $icon = 'fas fa-bath';
break; break;
case 'plotsize': case 'plotsize':
$icon = $prefix . '-' . 'map'; $icon = 'fas fa-map';
break; break;
case 'areasize': case 'areasize':
$icon = $prefix . '-' . 'arrows-alt'; $icon = 'fas fa-arrows-alt';
break; break;
case 'orientation': case 'orientation':
$icon = $prefix . '-' . 'compass'; $icon = 'fas fa-compass';
break; break;
case 'livingrooms': case 'livingrooms':
$icon = $prefix . '-' . 'tv'; $icon = 'fas fa-tv';
break; break;
case 'kitchens': case 'kitchens':
$icon = $prefix . '-' . 'utensils'; $icon = 'fas fa-utensils';
break; break;
case 'amountrooms': case 'amountrooms':
$icon = $prefix . '-' . 'building'; $icon = 'fas fa-building';
break; break;
default: default:
$icon = $key; $icon = $key;
break; break;
} }
$classes[] = apply_filters( 'opalestate_property_meta_icon', $icon, $key ); $classes .= ' ';
return esc_attr( implode( ' ', array_map( 'sanitize_html_class', $classes ) ) ); $classes .= apply_filters( 'opalestate_property_meta_icon', $icon, $key );
return $classes;
} }