This commit is contained in:
Alpha
2020-08-03 09:04:25 +07:00
parent 6aa79b2f11
commit 92f5c23439
5 changed files with 44 additions and 23 deletions

View File

@@ -12,15 +12,22 @@ $attachments = $property->get_attachments();
<h5 class="list-group-item-heading"><?php esc_html_e( 'Attachments', 'opalestate-pro' ); ?></h5>
<div class="list-group-item-text">
<div class="<?php echo apply_filters( 'opalestate_row_container_class', 'opal-row' ); ?>">
<?php foreach ( $attachments as $id => $attachment ) :
$attachment_title = get_the_title( $id );
?>
<?php if ( is_array( $attachments ) ) : ?>
<?php foreach ( $attachments as $id => $attachment ) : ?>
<div class="col-lg-4 col-sm-4">
<i class="text-secondary fa fa-file-text-o"></i>
<a class="property-attachments__name" href="<?php echo esc_url( $attachment ); ?>"><?php echo esc_html( get_the_title( $id ) ); ?></a>
<a class="property-attachments__download" href="<?php echo esc_url( $attachment ); ?>" download><?php esc_html_e( 'Download', 'opalestate-pro' ); ?></a>
</div>
<?php endforeach; ?>
<?php else : ?>
<?php $attachment_id = absint( $attachments ); ?>
<div class="col-lg-4 col-sm-4">
<i class="text-secondary fa fa-file-text-o"></i>
<a class="property-attachments__name" href="<?php echo esc_url( $attachment ); ?>" target="_blank"><?php echo esc_html( $attachment_title ); ?></a>
<a class="property-attachments__download" href="<?php echo esc_url( $attachment ); ?>" target="_blank"><?php esc_html_e( 'Download', 'opalestate-pro' ); ?></a>
<a class="property-attachments__name" href="<?php echo esc_url( get_permalink( $attachment_id ) ); ?>"><?php echo esc_html( get_the_title( $attachment_id ) ); ?></a>
<a class="property-attachments__download" href="<?php echo esc_url( get_permalink( $attachment_id ) ); ?>" download><?php esc_html_e( 'Download', 'opalestate-pro' ); ?></a>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>