| 1 |
<?php |
| 2 |
/** |
| 3 |
* Single Property Material Information |
| 4 |
* |
| 5 |
* @author PropertyHive |
| 6 |
* @package PropertyHive/Templates |
| 7 |
* @version 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 11 |
|
| 12 |
global $post, $property; |
| 13 |
|
| 14 |
$material_information = $property->get_material_information(); |
| 15 |
|
| 16 |
if ( empty($material_information) ) |
| 17 |
{ |
| 18 |
return; |
| 19 |
} |
| 20 |
?> |
| 21 |
<div class="property-material-information" style="min-width:400px"> |
| 22 |
|
| 23 |
<h2><?php echo esc_html( __( 'Utilities & More', 'propertyhive' ) ); ?></h2> |
| 24 |
|
| 25 |
<?php do_action( 'propertyhive_property_material_information_start' ); ?> |
| 26 |
|
| 27 |
<?php |
| 28 |
foreach ( $material_information as $key => $value ) |
| 29 |
{ |
| 30 |
$label = $key; |
| 31 |
$label = str_replace("_", " ", $label); |
| 32 |
$label = ucwords($label); |
| 33 |
echo '<h4>' . esc_html( __( $label, 'propertyhive' ) ) . '</h4>'; |
| 34 |
|
| 35 |
if ( is_array($value) && !empty($value) ) |
| 36 |
{ |
| 37 |
foreach ( $value as $subkey => $subvalue ) |
| 38 |
{ |
| 39 |
$label = $subkey; |
| 40 |
$label = str_replace("_", " ", $label); |
| 41 |
$label = ucwords($label); |
| 42 |
|
| 43 |
echo '<strong>' . esc_html( __( $label, 'propertyhive' ) ) . ':</strong> ' . esc_html($subvalue) . '<br>'; |
| 44 |
} |
| 45 |
} |
| 46 |
else |
| 47 |
{ |
| 48 |
echo '<strong>' . esc_html( __( $label, 'propertyhive' ) ) . ':</strong> ' . esc_html($value) . '<br>'; |
| 49 |
} |
| 50 |
} |
| 51 |
?> |
| 52 |
|
| 53 |
<?php do_action( 'propertyhive_property_material_information_end' ); ?> |
| 54 |
|
| 55 |
</div> |