Exemplo n.º 1
0
 /**
  * issue 718
  */
 function test_show_on_map_url_parameters()
 {
     global $geo_mashup_options;
     $page_id = $this->factory->post->create(array('post_type' => 'page'));
     $geo_mashup_options->set_valid_options(array(array('overall' => array('mashup_page' => $page_id))));
     $post_id = $this->factory->post->create();
     $location = $this->rand_location(4);
     GeoMashupDB::set_object_location('post', $post_id, $location, false);
     $test_query = new WP_Query(array('p' => $post_id));
     $test_query->the_post();
     $test_args = array('text' => 'TEST TEXT', 'zoom' => 10);
     $this->assertNotContains('text=', GeoMashup::show_on_map_link($test_args));
     $this->assertContains('zoom=10', GeoMashup::show_on_map_link($test_args));
 }
Exemplo n.º 2
0
        ?>
			
			<p class="postmeta">
			<?php 
        if (!is_page()) {
            ?>
			<span class="postauthor">Pubblicato il <?php 
            the_time('j M y');
            ?>
 alle <?php 
            the_time();
            ?>
</span> 
			<?php 
            if (is_callable(array('GeoMashup', 'show_on_map_link'))) {
                $linkString = GeoMashup::show_on_map_link('text=Map%20&show_icon=false');
                if ($linkString != "") {
                    echo ' &#183; ';
                    echo $linkString;
                }
            }
            ?>
			&#183; <?php 
            _e('Contenuto in:');
            ?>
 <?php 
            the_category(', ');
            ?>
			<?php 
            $posttags = get_the_tags($post->ID);
            if ($posttags) {
 /**
  * issue 629
  */
 function test_map_link_outside_loop()
 {
     global $geo_mashup_options;
     $page_id = $this->factory->post->create(array('post_type' => 'page'));
     $geo_mashup_options->set_valid_options(array(array('overall' => array('mashup_page' => $page_id))));
     $post_id = $this->factory->post->create();
     // Use 4 decimal places in location to get 5 good total characters to check in link
     $location = $this->rand_location(4);
     GeoMashupDB::set_object_location('post', $post_id, $location, false);
     $test_query = new WP_Query(array('p' => $post_id));
     $this->assertTrue($test_query->have_posts());
     $test_query->the_post();
     $this->assertFalse($test_query->have_posts());
     $this->assertContains('center_lat=' . substr($location->lat, 0, 5), GeoMashup::show_on_map_link());
 }