Viewing 1 replies (of 1 total)
  • Thread Starter Matt

    (@mugwumpman)

    Actually, hope you don’t mind, but I hacked my self-hosted copy. Here’s my modified code in case you’d like to make use of it for future versions.

    //Get address through shortcode
     function simply_map_me($atts,$content= null ){
    	 shortcode_atts( array(
    		'width' => 425,
    		'height' => 350,
    	), $atts) ;
    
    	 if(isset($atts['width'])) $width = $atts['width']; else $width = 425;
    	  if(isset($atts['height'])) $height = $atts['height']; else $height = 350;
    	   if(isset($atts['type'])) { if($atts['type'] = 'satellite') $type = '&t=h'; else $type = ''; } //THIS IS THE NEW LINE OF CODE, ALONG WITH ADDING $type AFTER THE $content VARIABLE IN THE RETURNED LINK
    	return "<strong>".$content."</strong><br/><br/><p><iframe width=".$width." height=".$height." frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?oe=utf-8&channel=fflb&q=".$content."&ie=UTF8&hq=&hnear=".$content.$type."&output=embed'></iframe></p><br />";
    	 }
    
    add_shortcode('map','simply_map_me');

    (Coincidentally I also moved the settings page under the settings tab by changing…

    add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function );

    …to…

    $parent_slug	=	'options-general.php';
    add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );

    …)

Viewing 1 replies (of 1 total)
  • The topic ‘Map vs Satellite’ is closed to new replies.