| 1 |
<?php |
| 2 |
/** |
| 3 |
* Single Property Images |
| 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, $propertyhive, $property; |
| 13 |
?> |
| 14 |
<div class="images"> |
| 15 |
|
| 16 |
<?php do_action( 'propertyhive_before_single_property_images' ); ?> |
| 17 |
|
| 18 |
<?php |
| 19 |
if ( isset($images) && is_array($images) && !empty($images) ) { |
| 20 |
|
| 21 |
echo '<div id="slider" class="flexslider"><ul class="slides">'; |
| 22 |
|
| 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 ($images as $image) |
| 25 |
{ |
| 26 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Gallery URLs and attributes are escaped during assembly; preserve the trusted PHP gallery HTML filter. |
| 27 |
echo '<li>' . apply_filters( 'propertyhive_single_property_image_html', sprintf( '<a href="%s" class="propertyhive-main-image" title="%s" data-fancybox="gallery-' . (int)$post->ID . '">%s</a>', esc_url( $image['url'] ), esc_attr( $image['title'] ), $image['image'] ), $post->ID ) . '</li>'; |
| 28 |
} |
| 29 |
|
| 30 |
echo '</ul></div>'; |
| 31 |
|
| 32 |
} else { |
| 33 |
|
| 34 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Gallery URLs and attributes are escaped during assembly; preserve the trusted PHP gallery HTML filter. |
| 35 |
echo apply_filters( 'propertyhive_single_property_image_html', sprintf( '<img src="%s" alt="Placeholder" />', esc_url( ph_placeholder_img_src() ) ), $post->ID ); |
| 36 |
|
| 37 |
} |
| 38 |
?> |
| 39 |
|
| 40 |
<?php do_action( 'propertyhive_product_thumbnails' ); ?> |
| 41 |
|
| 42 |
<?php do_action( 'propertyhive_after_single_property_images' ); ?> |
| 43 |
|
| 44 |
</div> |
| 45 |
|