function jeo_find_post_on_map_button($zoom = null, $text = false, $post_id = false) { if (!jeo_the_map()) { return false; } global $post; $post_id = $post_id ? $post_id : $post->ID; $text = $text ? $text : __('Locate on map', 'jeo'); $geometry = jeo_get_element_geometry_data($post_id); if (!$geometry) { return false; } if (!$zoom) { $map_data = jeo_get_map_data(); $zoom = $map_data['max_zoom']; } $zoom_attr = 'data-zoom="' . $zoom . '"'; return apply_filters('jeo_find_post_on_map_button', '<a class="find-on-map center-map" ' . $geometry . ' ' . $zoom_attr . ' href="#"><span class="lsf"></span> ' . $text . '</a>'); }
function the_post_map($p = false) { global $post; $p = $p ? $p : $post; $map = jeo_the_map(); if (is_single() && $this->has_location($p->ID) && !is_singular(array('map', 'map-group'))) { $post_maps = get_post_meta($p->ID, 'maps'); if (!$map) { if ($post_maps) { $map = get_post(array_shift($post_maps)); } else { $map = jeo_map_featured(); } jeo_set_map($map); } } return jeo_the_map(); }