# propertyhive/2.2.2/includes/avada-widgets/property-map-shortcode.php

Property Hive, version 2.2.2. 49 lines.

- Page: https://pluginprobe.com/plugins/propertyhive/2.2.2/code/includes/avada-widgets/property-map-shortcode.php
- Raw: https://pluginprobe.com/plugins/propertyhive/2.2.2/raw/includes/avada-widgets/property-map-shortcode.php
- Modified: 2025-04-01T10:48:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/propertyhive/2.2.2/code/includes/avada-widgets/property-map-shortcode.php#L10-L20`.

```php
<?php

add_shortcode( 'avada_property_map', function( $atts ) {
    $atts = shortcode_atts( array(
        'height'    => '',
        'zoom' => '',
        'scrollwheel' => '',
    ), $atts );

    if ( get_post_type( get_the_ID() ) != 'property' )
    {
    	return '';
    }

    fusion_element_rendering_elements( true );

    global $property;
    
    if ( empty($property) )
    {
        $property = new PH_Property(get_the_ID());
    }
    
    ob_start();

    $attributes = array();
    if ( isset($atts['height']) && $atts['height'] != '' )
    {
        $attributes['height'] = $atts['height'];
    }
    if ( isset($atts['zoom']) && isset($atts['zoom']['size']) && $atts['zoom']['size'] != '' )
    {
        $attributes['zoom'] = $atts['zoom']['size'];
    }
    if ( isset($atts['scrollwheel']) && $atts['scrollwheel'] != '' )
    {
        $attributes['scrollwheel'] = $atts['scrollwheel'];
    }

    $attributes = apply_filters( 'propertyhive_avada_property_map_attributes', $attributes );

    get_property_map($attributes);

    $html = ob_get_clean();

    fusion_element_rendering_elements( false );

    return $html;
});
```
