Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function crazyland_maps_shortcode($atts) {
- $default = array(
- 'lat' => '22.9196383',
- 'lon' => '91.520781',
- 'zoom' => '16',
- 'width' => '600',
- 'height' => '400',
- );
- $map_data = shortcode_atts( $default, $atts);
- $img = '<img src="http://maps.google.com/maps/api/staticmap?center=%f,%f&zoom=%d&size=%dx%d" />';
- return sprintf($img,$map_data['lat'],$map_data['lon'],$map_data['zoom'],$map_data['width'],$map_data['height']);
- }
- add_shortcode( 'maps', 'crazyland_maps_shortcode');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement