exovia GDPR Google Maps Shortcode

Below, you’ll find a detailed guide on how to add the exovia GDPR Google Maps Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the exovia GDPR Google Maps Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the exovia GDPR Google Maps Plugin and the shortcodes it provides:

Plugin Icon
exovia GDPR Google Maps

"Exovia GDPR Google Maps is a WordPress plugin designed to integrate Google Maps on your website while complying with GDPR guidelines. It ensures user data protection and privacy."

★★★★☆ (10) Active Installs: 3000+ Tested with: 6.2.3 PHP Version: 7.0
Included Shortcodes:
  • [exactly-gdpr-map]

exovia GDPR Google Maps [exactly-gdpr-map] Shortcode

The Exactly GDPR Google Maps shortcode integrates a GDPR compliant Google Map into your WordPress site. It fetches map options, parses the iframe, sets attributes, and creates a styled map interface.

Shortcode: [exactly-gdpr-map]

Examples and Usage

Basic Example – Loads the GDPR-compliant Google Map using default settings set in the plugin options.

[exactly-gdpr-map /]

Advanced Examples

Loads the GDPR-compliant Google Map with custom width and height. Width and height are specified in pixels.

[exactly-gdpr-map width="500" height="300" /]

Loads the GDPR-compliant Google Map with custom colors. The background color, button background color, and font color are specified in hexadecimal color codes.

[exactly-gdpr-map background_color="#ffffff" button_background_color="#000000" font_color="#ff0000" /]

Loads the GDPR-compliant Google Map with a custom button title.

[exactly-gdpr-map button_title="Click Here to View Map" /]

Loads the GDPR-compliant Google Map with a custom layer text and anchor text for the Google privacy policy link.

[exactly-gdpr-map layer_text="Your custom layer text here" anchor_text="Google Privacy Policy" /]

Please note that these examples assume that the ‘exactly-gdpr-google-maps’ plugin is installed and activated, and that the shortcodes are placed in a post or page within the WordPress editor.

PHP Function Code

In case you have difficulties debugging what causing issues with [exactly-gdpr-map] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'exactly-gdpr-map', 'exggmap_google_map_gdpr_code' );

Shortcode PHP function:

                    function exggmap_google_map_gdpr_code()
{ 
  $options = exggmap_get_options();
  $iframe = $options['exggmap_google_iframe']; 
  $simpleXML = simplexml_load_string($iframe);
  if($simpleXML == false){
    echo 'Parse Error';
  }
  $iframeAttributes = $simpleXML->attributes();
  $width = $options['exggmap_map_width'];
  $height = $options['exggmap_map_height'];
  $background_color = $options['exggmap_layer_background_color'];
  $button_background_color = $options['exggmap_button_background_color'];
  $font_color = $options['exggmap_layer_font_color'];
  $box_styles = 'style="width:' . $width .'px; height: '. $height .'px;'.'"';
  $embed_powered_by =  $options['exggmap_enable_powered_by'];
  $aspect_ratio = 'aspect-ratio:' .  $width . ' / ' . $height; 
 
	ob_start();      
	?>
    <div class="exggmap-wrapper is-style-wide" style="<?php echo $aspect_ratio; ?>">
      <div class="exggmap-mask" style="background-color: <?php echo $background_color; ?>; color:<?php echo $font_color ?>">
        <div class="exggmap-mask-content">
        <p class="exggmap-caption"><?php echo __('GDPR MAP', 'exactly-gdpr-google-maps') ?></p>
            <button style="color: <?php echo $font_color; ?>; background-color: <?php echo $button_background_color; ?>; border-color: <?php echo $font_color; ?>"  id="exggmap-btn"><?php echo $options['exggmap_button_title']; ?> *</button>
        </div>
        <?php if( $embed_powered_by ){ ?>
        <span>
           <?php echo __('powered by', 'exactly-gdpr-google-maps'); ?>
            <a style="color: <?php echo $font_color; ?>" href="https://www.exovia.de">exovia webdesign</a>
        </span>
        <?php } ?>
      </div>
      <iframe 
        data-src="<?php echo $iframeAttributes->{'src'}; ?>" 
        frameborder="0" 
        allowfullscreen="" 
        aria-hidden="false" 
        tabindex="0">
      </iframe>
    </div>
    <p class="exampp-hints">
    * <?php echo $options['exggmap_layer_text']; ?>
      <a 
        target="_blank" 
        rel="noopener noreferrer"
        href="<?php echo __("https://policies.google.com/privacy?hl=en", "exactly-gdpr-google-maps"); ?>"><?php echo $options['exggmap_anchor_text']?></a>
    </p>
	<?php
	return $var = ob_get_clean();
}
                    

Code file location:

exactly-gdpr-google-maps/exactly-gdpr-google-maps/includes/exggmap-shortcode.php

Conclusion

Now that you’ve learned how to embed the exovia GDPR Google Maps Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *