{"id":966033,"date":"2015-05-29T10:04:45","date_gmt":"2015-05-29T17:04:45","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/"},"modified":"2015-06-01T13:07:40","modified_gmt":"2015-06-01T20:07:40","slug":"get-google-maps-link","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/","title":{"rendered":"Get Google Maps Link"},"content":{"rendered":"<p>Hello.<br \/>\nWe have built a custom display of events for our site. We are using tribe_get_events then a foreach loop to display each event. In the foreach loop, we successfully display tribe_get_address and tribe_get_start_date, but are not able to do tribe_get_map_link_html.<\/p>\n<p>tribe_get_map_link_html returns this (no href value):<br \/>\n<code>&lt;a class=&quot;tribe-events-gmap&quot; href=&quot;&quot; title=&quot;Click to view a Google Map&quot; target=&quot;_blank&quot;&gt;+ Google Map&lt;\/a&gt;<\/code><\/p>\n<p>We also tried tribe_get_map_link but it returns nothing.<\/p>\n<p>We want to return just the url for the map so that we can wrap it in our own <code>&lt;a&gt;<\/code> tag. How can we get the Google Maps link from the event?<\/p>\n<p>Our full code:<\/p>\n<pre><code>$today = strtotime(&#039;-5 hours&#039;);\n\t\t\t\t\t\t$daycount = 0;\n\t\t\t\t\t\t\/* echo date(&quot;n\/j D G:i e&quot;, $today); *\/\n\t\t\t\t\t\techo &#039;&lt;div class=&quot;cal-toggle&quot;&gt;&lt;button class=&quot;cal-toggle-button&quot;&gt;Click To View Our Weekly Schedule&lt;div class=&quot;arrow-down red&quot;&gt;&lt;\/div&gt;&lt;\/button&gt;&lt;\/div&gt;\n\t\t\t\t\t\t&lt;div class=&quot;mm-cal-wrapper&quot;&gt;\n\t\t\t\t\t                        &lt;div class=&quot;mm-cal-container&quot;&gt;\n\t\t\t\t\t                        &lt;div class=&quot;mm-cal-grid-wrapper&quot;&gt;\n\t\t\t\t\t                        &lt;ul class=&quot;mm-cal-grid&quot;&gt;&#039;;\n\t\t\t\t\t\twhile($daycount&lt;14) {\n\t\t\t\t\t\t\t\/* each day *\/\n\t\t\t\t\t\t\techo &#039;&lt;li class=&quot;mm-cal-day&quot;&gt;&#039;;\n\t\t\t\t\t\t\techo &#039;&lt;span class=&quot;mm-cal-day-date&quot;&gt;&#039; .date(&quot;n\/j D&quot;, strtotime(&#039;+&#039;.$daycount.&#039; day&#039;)). &#039;&lt;\/span&gt;&#039;;\n\t\t\t\t\t\t\techo &#039;&lt;ul class=&quot;mm-cal-events&quot;&gt;&#039;;\n\t\t\t\t\t\t\t$events = tribe_get_events( array(\n\t\t\t\t\t\t\t\t &#039;start_date&#039;\t=&gt; date( &#039;Y-m-d H:i:s&#039;, strtotime(&#039;+&#039;.$daycount.&#039; day&#039;) ),\n\t\t\t\t\t\t\t\t &#039;end_date&#039;\t\t=&gt; date( &#039;Y-m-d H:i:s&#039;, strtotime(&#039;+&#039;.++$daycount.&#039; day&#039;) ),\n\t\t\t\t\t\t\t\t &#039;eventDisplay&#039;\t=&gt; &#039;custom&#039;\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tif ( empty( $events ) ) {\n\t\t\t\t\t\t\t    echo &#039;&amp;nbsp;&#039;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse foreach( $events as $event ) {\n\t\t\t\t\t\t\t    $locationname = tribe_get_address( $event );\n\t\t\t\t\t\t\t    $locationlink = tribe_get_map_link_html( $event );\n\t\t\t\t\t\t\t    echo &#039;&lt;li class=&quot;mm-cal-event&quot;&gt;&lt;span class=&quot;mm-cal-event-detail time&quot;&gt;&#039;;\n\t\t\t\t\t\t\t    echo tribe_get_start_date($event) . &#039;-&#039; . tribe_get_end_date($event);\n\t\t\t\t\t\t\t    echo &#039;&lt;\/span&gt;&lt;br&gt;&lt;span&gt;&#039;;\n\t\t\t\t\t\t\t    echo $locationname;\n\t\t\t\t\t\t\t    echo $locationlink;\n\t\t\t\t\t\t\t    echo &#039;&lt;\/span&gt;&lt;\/li&gt;&#039;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\/* end each day *\/ \n\t\t\t\t\t\t\techo &#039;&lt;\/ul&gt;&lt;\/li&gt;&#039;;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo &#039; &lt;\/ul&gt;\n                        \n                        &lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&#039;;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-966033","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Get Google Maps Link -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Google Maps Link -\" \/>\n<meta property=\"og:description\" content=\"Hello. We have built a custom display of events for our site. We are using tribe_get_events then a foreach loop to display each event. In the foreach loop, we successfully display tribe_get_address and tribe_get_start_date, but are not able to do tribe_get_map_link_html. tribe_get_map_link_html returns this (no href value): &lt;a class=&quot;tribe-events-gmap&quot; href=&quot;&quot; title=&quot;Click to view a Google [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-06-01T20:07:40+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/\",\"name\":\"Get Google Maps Link -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-05-29T17:04:45+00:00\",\"dateModified\":\"2015-06-01T20:07:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Get Google Maps Link\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get Google Maps Link -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/","og_locale":"en_US","og_type":"article","og_title":"Get Google Maps Link -","og_description":"Hello. We have built a custom display of events for our site. We are using tribe_get_events then a foreach loop to display each event. In the foreach loop, we successfully display tribe_get_address and tribe_get_start_date, but are not able to do tribe_get_map_link_html. tribe_get_map_link_html returns this (no href value): &lt;a class=&quot;tribe-events-gmap&quot; href=&quot;&quot; title=&quot;Click to view a Google [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/","article_modified_time":"2015-06-01T20:07:40+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/","name":"Get Google Maps Link -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-05-29T17:04:45+00:00","dateModified":"2015-06-01T20:07:40+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/get-google-maps-link\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Get Google Maps Link"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/966033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/966033\/revisions"}],"predecessor-version":[{"id":966035,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/966033\/revisions\/966035"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=966033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}