rep__the_embed_map_field()

This function takes a field value and generates the HTML markup for displaying an embed map. The embed map is typically an iframe that embeds a map from a specific source or provider.

Namespace

REP_Malcolm

Parameters

$val

string

The value containing the embed map URL.

$type

string

The type of HTML escaping to apply. Default is “HTMLspecialchars”.

$width

string

The width of the embed map. Default is “600”.

$height

string

The height of the embed map. Default is “450”.

Return

string

The HTML markup for displaying the embed map.

Source

File: \includes\rep-helper-functions.php

function rep__the_embed_map_field( $val , $type="htmlspecialchars", $width="600", $height="450"){  
    ob_start();
    
    if($val) : 
        if($type == 'htmlspecialchars')
            echo htmlspecialchars('<iframe width="'.$width.'" height="'.$height.'" style="border:0" loading="lazy" allowfullscreen src="' . $val . '"></iframe>');  
        else
            echo '<iframe width="'.$width.'" height="'.$height.'" style="border:0" loading="lazy" allowfullscreen src="' . $val . '"></iframe>';  
    endif;

    $html = ob_get_clean();
    return $html;
}