{"id":1279200,"date":"2017-05-05T07:46:59","date_gmt":"2017-05-05T14:46:59","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/"},"modified":"2017-05-08T23:15:19","modified_gmt":"2017-05-09T06:15:19","slug":"renaming-events-views-problem","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/","title":{"rendered":"Renaming Events Views Problem"},"content":{"rendered":"<p>This issue seems to have been flagged back in Jan 2016 but I cannot find any resolution.<\/p>\n<p>I followed suggested code to change the name of Photo View to Poster. However when I am in other views (eg. month or list) and I select &#8220;Poster&#8221; the link is still set to \/photo and I get a 404 error. Here is the code I used.<\/p>\n<p>\/\/ We want to adapt the names of views listed within the Tribe Events Bar<br \/>\nadd_filter( &#8216;tribe-events-bar-views&#8217;, &#8216;rename_tribe_views_in_selector&#8217;, 100 );<\/p>\n<p>function rename_tribe_views_in_selector( $views ) {<br \/>\n\/\/ This lists the original view names you wish to change along<br \/>\n\/\/ with the substitutes to wish to use in their place<br \/>\n$to_change = array(<br \/>\n&#8216;List&#8217; =&gt; &#8216;List&#8217;,<br \/>\n&#8216;Month&#8217; =&gt; &#8216;Month&#8217;,<br \/>\n&#8216;Photo&#8217; =&gt; &#8216;Poster&#8217;,<br \/>\n);<\/p>\n<p>\/\/ Look through the list of active views and modify names accordingly<br \/>\nforeach ( $views as &amp;$view )<br \/>\nif ( isset( $to_change[ $view[&#8216;anchor&#8217;] ] ) )<br \/>\n$view[&#8216;anchor&#8217;] = $to_change[ $view[&#8216;anchor&#8217;] ];<\/p>\n<p>\/\/ Return our revised list<br \/>\nreturn $views;<br \/>\n}<\/p>\n<p>\/**<br \/>\n* Modify the &#8220;bases&#8221; used to form event URLs for various views.<br \/>\n*<br \/>\n* @param array $bases<br \/>\n*<br \/>\n* @return array<br \/>\n*\/<br \/>\nfunction rename_event_view_slugs( $bases ) {<br \/>\nif ( isset( $bases[&#8216;month&#8217;] ) ) $bases[&#8216;month&#8217;] = [ &#8216;month&#8217;, &#8216;month&#8217; ];<br \/>\nif ( isset( $bases[&#8216;list&#8217;] ) ) $bases[&#8216;list&#8217;] = [ &#8216;list&#8217;, &#8216;list&#8217; ];<br \/>\nif ( isset( $bases[&#8216;photo&#8217;] ) ) $bases[&#8216;photo&#8217;] = [ &#8216;poster&#8217;, &#8216;poster&#8217; ];<br \/>\nreturn $bases;<br \/>\n}<br \/>\n\/**<br \/>\n* Wire up our code used to modify event slugs in the rewrite rules.<br \/>\n*\/<br \/>\nadd_filter( &#8216;tribe_events_rewrite_base_slugs&#8217;, &#8216;rename_event_view_slugs&#8217;, 20 );<\/p>\n","protected":false},"template":"","class_list":["post-1279200","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>Renaming Events Views Problem -<\/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\/renaming-events-views-problem\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Renaming Events Views Problem -\" \/>\n<meta property=\"og:description\" content=\"This issue seems to have been flagged back in Jan 2016 but I cannot find any resolution. I followed suggested code to change the name of Photo View to Poster. However when I am in other views (eg. month or list) and I select &#8220;Poster&#8221; the link is still set to \/photo and I get [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-09T06:15:19+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=\"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\/renaming-events-views-problem\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/\",\"name\":\"Renaming Events Views Problem -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-05-05T14:46:59+00:00\",\"dateModified\":\"2017-05-09T06:15:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/#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\":\"Renaming Events Views Problem\"}]},{\"@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":"Renaming Events Views Problem -","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\/renaming-events-views-problem\/","og_locale":"en_US","og_type":"article","og_title":"Renaming Events Views Problem -","og_description":"This issue seems to have been flagged back in Jan 2016 but I cannot find any resolution. I followed suggested code to change the name of Photo View to Poster. However when I am in other views (eg. month or list) and I select &#8220;Poster&#8221; the link is still set to \/photo and I get [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/","article_modified_time":"2017-05-09T06:15:19+00:00","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\/renaming-events-views-problem\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/","name":"Renaming Events Views Problem -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-05-05T14:46:59+00:00","dateModified":"2017-05-09T06:15:19+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/renaming-events-views-problem\/#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":"Renaming Events Views Problem"}]},{"@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\/1279200","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\/1279200\/revisions"}],"predecessor-version":[{"id":1280656,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1279200\/revisions\/1280656"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1279200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}