PluginProbe
Property Hive / 2.2.3
Property Hive v2.2.3
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-map-link-html.php

property-map-link-html.php in Property Hive 2.2.3, at includes/salient-widgets/property-map-link-html.php

64 lines 1.9 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 $css = '';
6
7 extract(shortcode_atts(array(
8 'map_link_type' => '_blank',
9 "css" => "",
10 "font_container" => "",
11 ), $atts));
12
13 global $property;
14
15 if ( !isset($property->id) ) {
16 return;
17 }
18
19 if ( $property->latitude == '' || $property->longitude == '' || $property->latitude == '0' || $property->longitude == '0' )
20 {
21 return;
22 }
23
24 $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts );
25
26 $style = '';
27 if ( ! empty( $atts['font_container'] ) && isset($atts['font_container']) )
28 {
29 $style = ph_extract_font_style_from_salient_font_container( $font_container );
30 }
31
32 echo '<div class="' . esc_attr( $css_class ) . '" ' . $style . '>';
33
34 $link_type = ( isset($atts['map_link_type']) && !empty($atts['map_link_type']) ) ? $atts['map_link_type'] : '_blank';
35
36 switch ($link_type)
37 {
38 case "_blank":
39 {
40 echo '<a href="https://www.google.com/maps/?q=' . (float)$property->latitude . ',' . (float)$property->longitude . '&ll=' . (float)$property->latitude . ',' . (float)$property->longitude . '" target="_blank">' . esc_html(__( 'View Map', 'propertyhive' )) . '</a>';
41 break;
42 }
43 case "embedded":
44 {
45 echo '<a href="#map_lightbox" data-fancybox>' . __( 'View Map', 'propertyhive' ) . '</a>';
46
47 echo '<div id="map_lightbox" style="display:none; width:90%; max-width:800px;">';
48 echo do_shortcode('[property_map]');
49 echo '</div>';
50 break;
51 }
52 case "iframe":
53 {
54 echo '<a
55 href="#"
56 data-fancybox
57 data-type="iframe"
58 data-src="https://maps.google.com/?output=embed&amp;f=q&amp;q=' . (float)$property->latitude . ',' . (float)$property->longitude . '&amp;ll=' . (float)$property->latitude . ',' . (float)$property->longitude . '&amp;layer=t&amp;hq=&amp;t=m&amp;z=15"
59 >' . esc_html(__( 'View Map', 'propertyhive' )) . '</a>';
60 break;
61 }
62 }
63
64 echo '</div>';