{"id":1184429,"date":"2016-10-28T08:33:03","date_gmt":"2016-10-28T15:33:03","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/"},"modified":"2016-10-28T08:33:03","modified_gmt":"2016-10-28T15:33:03","slug":"how-to-open-google-calendar-link-in-a-new-tab","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/","title":{"rendered":"How to open Google Calendar link in a new tab"},"content":{"rendered":"<p>Hi,<\/p>\n<p>Client wants the Google Calendar to open in a new tab, on a single event page like http:\/\/841.ab2.mwp.accessdomain.com\/event\/lafayette-boot-camp\/ . <\/p>\n<p>I thought to rework and apply the code in venue.php, to ical.php, but no dice:<\/p>\n<pre><code>\tfunction tribe_get_gcal_link( $post_id = null, $label = null ) {\n\t\t$url = tribe_get_gcal_link_url( $post_id );\n\n\t\tif ( ! empty( $url ) ) {\n\t\t\t$label = is_null( $label ) ? $url : $label;\n\t\t\tif ( ! empty( $url ) ) {\n\t\t\t\t$parseUrl = parse_url( $url );\n\t\t\t\tif ( empty( $parseUrl[&#039;scheme&#039;] ) ) {\n\t\t\t\t\t$url = &quot;http:\/\/$url&quot;;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$html = sprintf(\n\t\t\t\t&#039;&lt;a href=&quot;%s&quot; target=&quot;%s&quot;&gt;%s&lt;\/a&gt;&#039;,\n\t\t\t\tesc_attr( esc_url( $url ) ),\n\t\t\t\tapply_filters( &#039;tribe_get_gcal_link_target&#039;, &#039;_blank&#039; ),\n\t\t\t\tapply_filters( &#039;tribe_get_gcal_link_label&#039;, esc_html( $label ) )\n\t\t\t);\n\t\t} else {\n\t\t\t$html = &#039;&#039;;\n\t\t}\n\n\t\treturn apply_filters( &#039;tribe_get_gcal_link&#039;, $html );\n\t}<\/code><\/pre>\n<p>Which returns this error: Fatal error: Call to undefined function tribe_get_gcal_link_url() in \/home\/content\/p3pnexwpnas15_data02\/33\/3250433\/html\/wp-content\/plugins\/the-events-calendar\/src\/functions\/template-tags\/ical.php on line 4 <\/p>\n<p>So we have to define a function, but this is where I go off the rails. Any ideas to help get this back on track?<\/p>\n<p>Thanks in advance,<\/p>\n","protected":false},"template":"","class_list":["post-1184429","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>How to open Google Calendar link in a new tab -<\/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\/how-to-open-google-calendar-link-in-a-new-tab\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to open Google Calendar link in a new tab -\" \/>\n<meta property=\"og:description\" content=\"Hi, Client wants the Google Calendar to open in a new tab, on a single event page like http:\/\/841.ab2.mwp.accessdomain.com\/event\/lafayette-boot-camp\/ . I thought to rework and apply the code in venue.php, to ical.php, but no dice: function tribe_get_gcal_link( $post_id = null, $label = null ) { $url = tribe_get_gcal_link_url( $post_id ); if ( ! empty( $url [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/\",\"name\":\"How to open Google Calendar link in a new tab -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-10-28T15:33:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/#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\":\"How to open Google Calendar link in a new tab\"}]},{\"@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":"How to open Google Calendar link in a new tab -","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\/how-to-open-google-calendar-link-in-a-new-tab\/","og_locale":"en_US","og_type":"article","og_title":"How to open Google Calendar link in a new tab -","og_description":"Hi, Client wants the Google Calendar to open in a new tab, on a single event page like http:\/\/841.ab2.mwp.accessdomain.com\/event\/lafayette-boot-camp\/ . I thought to rework and apply the code in venue.php, to ical.php, but no dice: function tribe_get_gcal_link( $post_id = null, $label = null ) { $url = tribe_get_gcal_link_url( $post_id ); if ( ! empty( $url [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/","name":"How to open Google Calendar link in a new tab -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-10-28T15:33:03+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/how-to-open-google-calendar-link-in-a-new-tab\/#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":"How to open Google Calendar link in a new tab"}]},{"@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\/1184429","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1184429\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1184429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}