PluginProbe
Property Hive / 2.3.1
Property Hive v2.3.1
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / salient-widgets / property-epcs-html.php

property-epcs-html.php in Property Hive 2.3.1, at includes/salient-widgets/property-epcs-html.php

69 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
5 extract(shortcode_atts(array(
6 "show_title" => "yes",
7 ), $atts));
8
9 global $property;
10
11 if ( !isset($property->id) ) {
12 return;
13 }
14
15 if ( isset($atts['show_title']) && $atts['show_title'] != 'yes' )
16 {
17 ?>
18 <style type="text/css">
19 .epcs h4 { display:none; }
20 </style>
21 <?php
22 }
23
24 if ( get_option('propertyhive_epcs_stored_as', '') == 'urls' )
25 {
26 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope.
27 $epc_urls = $property->_epc_urls;
28 if ( is_array($epc_urls) && !empty( $epc_urls ) )
29 {
30 echo '<div class="epcs">';
31
32 echo '<h4>' . esc_html(__( 'EPCs', 'propertyhive' )) . '</h4>';
33
34 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope.
35 foreach ($epc_urls as $epc)
36 {
37 echo '<a href="' . esc_url($epc['url']) . '" data-fancybox="epcs" rel="nofollow"><img src="' . esc_url($epc['url']) . '" alt=""></a>';
38 }
39
40 echo '</div>';
41 }
42 }
43 else
44 {
45 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope.
46 $epc_attachment_ids = $property->get_epc_attachment_ids();
47
48 if ( !empty($epc_attachment_ids) )
49 {
50 echo '<div class="epcs">';
51
52 echo '<h4>' . esc_html(__( 'EPCs', 'propertyhive' )) . '</h4>';
53
54 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope.
55 foreach ( $epc_attachment_ids as $attachment_id )
56 {
57 if ( wp_attachment_is_image($attachment_id) )
58 {
59 echo '<a href="' . esc_url(wp_get_attachment_url($attachment_id)) . '" data-fancybox="epcs" rel="nofollow"><img src="' . esc_url(wp_get_attachment_url($attachment_id)) . '" alt=""></a>';
60 }
61 else
62 {
63 echo '<a href="' . esc_url(wp_get_attachment_url($attachment_id)) . '" target="_blank" rel="nofollow">' . esc_html(__( 'View EPC', 'propertyhive' )) . '</a>';
64 }
65 }
66
67 echo '</div>';
68 }
69 }