| 1 |
<?php |
| 2 |
|
| 3 |
add_shortcode( 'avada_property_map', function( $atts ) { |
| 4 |
$atts = shortcode_atts( array( |
| 5 |
'height' => '', |
| 6 |
'zoom' => '', |
| 7 |
'scrollwheel' => '', |
| 8 |
), $atts ); |
| 9 |
|
| 10 |
if ( get_post_type( get_the_ID() ) != 'property' ) |
| 11 |
{ |
| 12 |
return ''; |
| 13 |
} |
| 14 |
|
| 15 |
fusion_element_rendering_elements( true ); |
| 16 |
|
| 17 |
global $property; |
| 18 |
|
| 19 |
if ( empty($property) ) |
| 20 |
{ |
| 21 |
$property = new PH_Property(get_the_ID()); |
| 22 |
} |
| 23 |
|
| 24 |
ob_start(); |
| 25 |
|
| 26 |
$attributes = array(); |
| 27 |
if ( isset($atts['height']) && $atts['height'] != '' ) |
| 28 |
{ |
| 29 |
$attributes['height'] = $atts['height']; |
| 30 |
} |
| 31 |
if ( isset($atts['zoom']) && isset($atts['zoom']['size']) && $atts['zoom']['size'] != '' ) |
| 32 |
{ |
| 33 |
$attributes['zoom'] = $atts['zoom']['size']; |
| 34 |
} |
| 35 |
if ( isset($atts['scrollwheel']) && $atts['scrollwheel'] != '' ) |
| 36 |
{ |
| 37 |
$attributes['scrollwheel'] = $atts['scrollwheel']; |
| 38 |
} |
| 39 |
|
| 40 |
$attributes = apply_filters( 'propertyhive_avada_property_map_attributes', $attributes ); |
| 41 |
|
| 42 |
get_property_map($attributes); |
| 43 |
|
| 44 |
$html = ob_get_clean(); |
| 45 |
|
| 46 |
fusion_element_rendering_elements( false ); |
| 47 |
|
| 48 |
return $html; |
| 49 |
}); |