{"id":24279,"date":"2012-08-29T07:58:38","date_gmt":"2012-08-29T14:58:38","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/"},"modified":"2015-07-07T06:25:59","modified_gmt":"2015-07-07T13:25:59","slug":"change-events-calendar-admin-form-strings-using-a-function","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/","title":{"rendered":"Change Events Calendar Admin Form Strings using a function"},"content":{"rendered":"<p>Based on the post from Jonah West, &#8220;Change Events Calendar Strings Without Editing Language Files&#8221; <\/p>\n<p>URL: https:\/\/theeventscalendar.com\/change-events-calendar-strings-without-editing-language-files\/<\/p>\n<p>Add reading up on &#8216;gettext&#8217;, I created a function to modify fields single event admin page for &#8220;The Events Calendar&#8221; since Jonah&#8217;s code only modifies the public page. I&#8217;ve run into an issue with the text modification for &#8220;Phone:&#8221; under &#8220;Event Location Details&#8221; to display &#8220;Venue Phone;&#8221;. This works correctly but the function also updates &#8220;Phone:&#8221; under the Event Organizer Details to also display &#8220;Venue Phone:&#8221;. <\/p>\n<p>I have been searching for an solution to refine my Switch\/Case statement to either &#8220;EventPhone&#8221; or &#8220;venue[Phone]&#8221;. So far I haven&#8217;t found any options. <\/p>\n<p>Can someone from Modern Tribe help? I am developing this on a local site before I upload the code to the Events Pro site. So, I don&#8217;t have a URL to show at the moment.<\/p>\n<p>Here is the code for my function, &#8220;theme_change_admin_field_name&#8221;.<\/p>\n<p>add_filter( &#8216;gettext&#8217;, &#8216;theme_change_admin_field_names&#8217;, 20, 3 );<br \/>\n\/**<br \/>\n * Change comment form default field names.<br \/>\n *<br \/>\n * @link http:\/\/codex.wordpress.org\/Plugin_API\/Filter_Reference\/gettext<br \/>\n *\/<br \/>\nfunction theme_change_admin_field_names( $translated_text, $text, $domain ) {<\/p>\n<p>    if ( is_admin() ) {<\/p>\n<p>        switch ( $translated_text ) {<\/p>\n<p>            case &#8216;Organizer Name:&#8217; :<\/p>\n<p>                $translated_text = __( &#8216;Contact:&#8217;, &#8216;theme_text_domain&#8217; );<br \/>\n                break;<\/p>\n<p>            case &#8216;Phone:&#8217; :<\/p>\n<p>                $translated_text = __( &#8216;Venue Phone:&#8217;, &#8216;theme_text_domain&#8217; );<br \/>\n                break;<\/p>\n<p>        }<\/p>\n<p>    }<\/p>\n<p>    return $translated_text;<br \/>\n}<\/p>\n","protected":false},"template":"","class_list":["post-24279","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>Change Events Calendar Admin Form Strings using a function -<\/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\/change-events-calendar-admin-form-strings-using-a-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change Events Calendar Admin Form Strings using a function -\" \/>\n<meta property=\"og:description\" content=\"Based on the post from Jonah West, &#8220;Change Events Calendar Strings Without Editing Language Files&#8221; URL: https:\/\/theeventscalendar.com\/change-events-calendar-strings-without-editing-language-files\/ Add reading up on &#8216;gettext&#8217;, I created a function to modify fields single event admin page for &#8220;The Events Calendar&#8221; since Jonah&#8217;s code only modifies the public page. I&#8217;ve run into an issue with the text modification for [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-07-07T13:25:59+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\/change-events-calendar-admin-form-strings-using-a-function\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/\",\"name\":\"Change Events Calendar Admin Form Strings using a function -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2012-08-29T14:58:38+00:00\",\"dateModified\":\"2015-07-07T13:25:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/#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\":\"Change Events Calendar Admin Form Strings using a function\"}]},{\"@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":"Change Events Calendar Admin Form Strings using a function -","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\/change-events-calendar-admin-form-strings-using-a-function\/","og_locale":"en_US","og_type":"article","og_title":"Change Events Calendar Admin Form Strings using a function -","og_description":"Based on the post from Jonah West, &#8220;Change Events Calendar Strings Without Editing Language Files&#8221; URL: https:\/\/theeventscalendar.com\/change-events-calendar-strings-without-editing-language-files\/ Add reading up on &#8216;gettext&#8217;, I created a function to modify fields single event admin page for &#8220;The Events Calendar&#8221; since Jonah&#8217;s code only modifies the public page. I&#8217;ve run into an issue with the text modification for [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/","article_modified_time":"2015-07-07T13:25:59+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\/change-events-calendar-admin-form-strings-using-a-function\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/","name":"Change Events Calendar Admin Form Strings using a function -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2012-08-29T14:58:38+00:00","dateModified":"2015-07-07T13:25:59+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-events-calendar-admin-form-strings-using-a-function\/#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":"Change Events Calendar Admin Form Strings using a function"}]},{"@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\/24279","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\/24279\/revisions"}],"predecessor-version":[{"id":977641,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/24279\/revisions\/977641"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=24279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}