Created
May 27, 2020 15:36
-
-
Save salehahmadbabu/694fd1366f7b8fa96de3294f9a85d007 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function philosophy_google_map($atts) { | |
$default = array( | |
'place' => __( 'Dhaka', 'philosophy' ), | |
'width' => '800', | |
'height' => '500', | |
'zoom' => '12', | |
); | |
$params = shortcode_atts( $default, $atts ); | |
$map = <<<EOD | |
<div> | |
<div> | |
<iframe width="{$params['width']}" height="{$params['height']}" | |
src="https://maps.google.com/maps?q={$params['place']}&t=&z={$params['zoom']}&ie=UTF8&iwloc=&output=embed" | |
frameborder="0" scrolling="no" marginheight="0" marginwidth="0"> | |
</iframe> | |
</div> | |
</div> | |
EOD; | |
return $map; | |
} | |
add_shortcode( 'googlemap', 'philosophy_google_map' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment