wpgmp_after_container - WP Maps Pro

15000+ live websites are using this google maps wordpress plugin.

wpgmp_after_container

This hook allows developers to insert custom HTML after the map container in the WP Maps Pro plugin. It is triggered after the map container is rendered, providing an opportunity to add additional content or functionality.

Usage

Developers can implement this hook in their theme’s functions.php file or in a custom plugin. It is particularly useful for adding custom messages, forms, or other elements directly after the map. When using this hook, ensure that the HTML added is well-formed and secure.

Example 1

Add a custom message after the map.

add_action('wpgmp_after_container', 'add_custom_message_after_map', 10, 2);

function add_custom_message_after_map($unused, $map) {
    echo '<div class="custom-message">Explore more with our interactive map!</div>';
}

Example 2

Insert a subscription form after the map.

add_action('wpgmp_after_container', 'add_subscription_form_after_map', 10, 2);

function add_subscription_form_after_map($unused, $map) {
    echo '<form action="#" method="post" class="subscription-form">
            <label for="email">Subscribe for updates:</label>
            <input type="email" id="email" name="email" required>
            <button type="submit">Subscribe</button>
          </form>';
}

Example 3

Display a promotional banner after the map.

add_action('wpgmp_after_container', 'add_promotional_banner_after_map', 10, 2);

function add_promotional_banner_after_map($unused, $map) {
    echo '<div class="promo-banner">Get a discount on our premium maps with code MAPS20!</div>';
}

Tip: Always sanitize and validate any user input or external data your code handles to ensure security and prevent vulnerabilities.

Install Plugin Now!

Buy this plugin exclusively on CodeCanyon! You’ll get free updates, full support, and if you’re not satisfied, we’ve got you covered with a 30-day money-back guarantee.