| @@ -18,55 +18,15 @@ | ||
| 18 | 18 | <ul> |
| 19 | 19 | |
| 20 | 20 | <?php do_action( 'propertyhive_property_meta_list_start' ); ?> |
| 21 | 21 | |
| 22 | - <?php if ( $property->reference_number != '' ) : ?><li class="ref"><?php _e( 'Ref', 'propertyhive' ); echo ': ' . $property->reference_number; ?></li><?php endif; ?> | |
| 23 | - | |
| 24 | - <?php if ( $property->property_type != '' ) { ?><li class="type"><?php _e( 'Type', 'propertyhive' ); echo ': ' . $property->property_type; ?></li><?php } ?> | |
| 25 | - | |
| 26 | - <?php if ( $property->availability != '' ) { ?><li class="availability"><?php _e( 'Availability', 'propertyhive' ); echo ': ' . $property->availability; ?></li><?php } ?> | |
| 27 | - | |
| 28 | - <?php if ( $property->department != 'commercial' ) { ?> | |
| 29 | - | |
| 30 | - <?php if ( $property->bedrooms > 0 ) { ?><li class="bedrooms"><?php _e( 'Bedrooms', 'propertyhive' ); echo ': ' . $property->bedrooms; ?></li><?php } ?> | |
| 31 | - | |
| 32 | - <?php if ( $property->bathrooms > 0 ) { ?><li class="bathrooms"><?php _e( 'Bathrooms', 'propertyhive' ); echo ': ' . $property->bathrooms; ?></li><?php } ?> | |
| 33 | - | |
| 34 | - <?php if ( $property->reception_rooms > 0 ) { ?><li class="receptions"><?php _e( 'Reception Rooms', 'propertyhive' ); echo ': ' . $property->reception_rooms; ?></li><?php } ?> | |
| 35 | - | |
| 36 | - <?php if ( $property->parking != '' ) { ?><li class="parking"><?php _e( 'Parking', 'propertyhive' ); echo ': ' . $property->parking; ?></li><?php } ?> | |
| 37 | - | |
| 38 | - <?php if ( $property->outside_space != '' ) { ?><li class="outside-space"><?php _e( 'Outside Space', 'propertyhive' ); echo ': ' . $property->outside_space; ?></li><?php } ?> | |
| 39 | - | |
| 40 | - <?php | |
| 41 | - switch ( $property->department ) | |
| 22 | + <?php | |
| 23 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone. | |
| 24 | + foreach ( $meta as $key => $value ) | |
| 42 | 25 | { |
| 43 | - case "residential-sales": | |
| 44 | - { | |
| 45 | - ?> | |
| 46 | - | |
| 47 | - <?php if ( $property->tenure != '' ) { ?><li class="tenure"><?php _e( 'Tenure', 'propertyhive' ); echo ': ' . $property->tenure; ?></li><?php } ?> | |
| 48 | - | |
| 49 | - <?php | |
| 50 | - break; | |
| 51 | - } | |
| 52 | - case "residential-lettings": | |
| 53 | - { | |
| 54 | - ?> | |
| 55 | - | |
| 56 | - <?php if ( $property->furnished != '' ) { ?><li class="furnished"><?php _e( 'Furnished', 'propertyhive' ); echo ': ' . $property->furnished; ?></li><?php } ?> | |
| 57 | - | |
| 58 | - <?php if ( $property->deposit > 0 ) { ?><li class="deposit"><?php _e( 'Deposit', 'propertyhive' ); echo ': ' . $property->get_formatted_deposit(); ?></li><?php } ?> | |
| 59 | - | |
| 60 | - <?php if ( $property->available_date != '') { ?><li class="available"><?php _e( 'Available', 'propertyhive' ); echo ': ' . $property->get_available_date(); ?></li><?php } ?> | |
| 61 | - | |
| 62 | - <?php | |
| 63 | - break; | |
| 64 | - } | |
| 26 | + echo '<li class="' . esc_attr( $key ) . '"><span>' . esc_html($value['label']) . ':</span> ' . esc_html($value['value']) . '</li>'; | |
| 65 | 27 | } |
| 66 | 28 | ?> |
| 67 | - | |
| 68 | - <?php } // end if residential ?> | |
| 69 | 29 | |
| 70 | 30 | <?php do_action( 'propertyhive_property_meta_list_end' ); ?> |
| 71 | 31 | |
| 72 | 32 | </ul> |