Update amenity icon.

This commit is contained in:
Hoang Huu
2019-09-26 14:52:40 +07:00
parent 251eaf8ac5
commit ab83165eb7
3 changed files with 51 additions and 34 deletions

View File

@@ -1,22 +1,36 @@
<?php
global $property, $post;
$amenities = $property->get_amenities();
$amenities = $property->get_amenities();
?>
<?php if ( $property->get_block_setting( 'amenities' ) && $amenities ): ?>
<div class="property-amenities box-inner-summary">
<h5 class="list-group-item-heading"><?php esc_html_e( "Amenities", "opalestate" ); ?></h5>
<h5 class="list-group-item-heading"><?php esc_html_e( 'Amenities', 'opalestate-pro' ); ?></h5>
<div class="list-group-item-text">
<div class="opal-row">
<?php foreach ( $amenities as $amenity ): ?>
<div class="col-lg-4 col-sm-4 <?php if ( has_term( $amenity->term_id, 'opalestate_amenities', $post ) ) : ?>active<?php endif; ?>">
<?php
if ( $image_id = get_term_meta( $amenity->term_id, 'opalestate_amt_image_id', true )) {
echo wp_get_attachment_image( $image_id );
}
?>
<?php echo esc_html( $amenity->name ); ?> <i class="fa fa-check"></i>
<?php
if ( apply_filters( 'opalestate_hide_unset_amenity', false ) && ! has_term( $amenity->term_id, 'opalestate_amenities', $post ) ) {
continue;
}
?>
<div class="col-lg-4 col-sm-4">
<div class="amenity-item <?php echo has_term( $amenity->term_id, 'opalestate_amenities', $post ) ? 'active' : ''; ?>">
<?php
if ( $icon = get_term_meta( $amenity->term_id, 'opalestate_amt_icon', true ) ) {
echo '<span class="amenity-icon"><i class="' . esc_attr( $icon ) . '"></i></span>';
} elseif ( $image_id = get_term_meta( $amenity->term_id, 'opalestate_amt_image_id', true ) ) {
echo wp_get_attachment_image( $image_id );
}
?>
<?php echo esc_html( $amenity->name ); ?>&nbsp;
<?php if ( has_term( $amenity->term_id, 'opalestate_amenities', $post ) ) : ?>
<?php echo apply_filters( 'opalestate_amenity_check_icon', '<i class="fa fa-check"></i>' ); ?>
<?php else : ?>
<?php echo apply_filters( 'opalestate_amenity_uncheck_icon', '<i class="fa fa-check"></i>' ); ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>