{"id":1351453,"date":"2017-09-19T13:59:21","date_gmt":"2017-09-19T20:59:21","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/"},"modified":"2017-09-19T14:01:40","modified_gmt":"2017-09-19T21:01:40","slug":"changing-string-of-text-in-post-content","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/","title":{"rendered":"Changing String of Text in Post Content"},"content":{"rendered":"<p>My company recently went through a name change\u2014from New York Society of Security Analysts (NYSSA) to CFA Society New York (CFANY)\u2014and I was hoping to easily change all pertinent references within event-post content accordingly.<\/p>\n<p>I had no luck with the below oft-referenced snippet <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/change-the-wording-of-any-bit-of-text-or-string\/\">found here<\/a>:<\/p>\n<pre><code>&lt;?php\n \n\/*\n * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR\n * See the codex to learn more about WP text domains:\n * http:\/\/codex.wordpress.org\/Translating_WordPress#Localization_Technology\n * Example Tribe domains: &#039;tribe-events-calendar&#039;, &#039;tribe-events-calendar-pro&#039;...\n *\/\nfunction tribe_custom_theme_text ( $translation, $text, $domain ) {\n \n\t\/\/ Put your custom text here in a key =&gt; value pair\n\t\/\/ Example: &#039;Text you want to change&#039; =&gt; &#039;This is what it will be changed to&#039;\n\t\/\/ The text you want to change is the key, and it is case-sensitive\n\t\/\/ The text you want to change it to is the value\n\t\/\/ You can freely add or remove key =&gt; values, but make sure to separate them with a comma\n\t\/\/ This example changes the label &quot;Venue&quot; to &quot;Location&quot;, and &quot;Related Events&quot; to &quot;Similar Events&quot;\n\t$custom_text = array(\n\t\t&#039;Venue&#039; =&gt; &#039;Location&#039;,\n\t\t&#039;Related %s&#039; =&gt; &#039;Similar %s&#039;,\n\t);\n \n\t\/\/ If this text domain starts with &quot;tribe-&quot;, &quot;the-events-&quot;, or &quot;event-&quot; and we have replacement text\n    \tif( (strpos($domain, &#039;tribe-&#039;) === 0 || strpos($domain, &#039;the-events-&#039;) === 0 || strpos($domain, &#039;event-&#039;) === 0) &amp;&amp; array_key_exists($translation, $custom_text) ) {\n\t\t$translation = $custom_text[$translation];\n\t}\n    return $translation;\n}\nadd_filter(&#039;gettext&#039;, &#039;tribe_custom_theme_text&#039;, 20, 3);<\/code><\/pre>\n<p>I plugged in the following:<\/p>\n<pre><code>\/*\n * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR\n * See the codex to learn more about WP text domains:\n * http:\/\/codex.wordpress.org\/Translating_WordPress#Localization_Technology\n * Example Tribe domains: &#039;tribe-events-calendar&#039;, &#039;tribe-events-calendar-pro&#039;...\n *\/\nfunction tribe_custom_theme_text ( $translation, $text, $domain ) {\n$custom_text = array(\n&#039;New York Society of Security Analysts&#039; =&gt; &#039;CFA Society New York&#039;,\n&#039;NYSSA&#039; =&gt; &#039;CFANY&#039;,\n);\nif( (strpos($domain, &#039;tribe-&#039;) === 0 || strpos($domain, &#039;the-events-&#039;) === 0 || strpos($domain, &#039;event-&#039;) === 0) &amp;&amp; array_key_exists($translation, $custom_text) ) {\n$translation = $custom_text[$translation];\n}\nreturn $translation;\n}\nadd_filter(&#039;gettext&#039;, &#039;tribe_custom_theme_text&#039;, 20, 3);<\/code><\/pre>\n<p>I have cleared my cache and waited plenty of time, but see no change. For what it&#8217;s worth, I was wondering whether this was simply because I was attempting to accomplish the task on my dev site (dev.cfany.org), but the function worked for (meta?) labels, just not for text within the content of the single event page as I intended.<\/p>\n","protected":false},"template":"","class_list":["post-1351453","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>Changing String of Text in Post Content -<\/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\/changing-string-of-text-in-post-content\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Changing String of Text in Post Content -\" \/>\n<meta property=\"og:description\" content=\"My company recently went through a name change\u2014from New York Society of Security Analysts (NYSSA) to CFA Society New York (CFANY)\u2014and I was hoping to easily change all pertinent references within event-post content accordingly. I had no luck with the below oft-referenced snippet found here: &lt;?php \/* * EXAMPLE OF CHANGING ANY TEXT (STRING) IN [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-09-19T21:01: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\/changing-string-of-text-in-post-content\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/\",\"name\":\"Changing String of Text in Post Content -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-09-19T20:59:21+00:00\",\"dateModified\":\"2017-09-19T21:01:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/#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\":\"Changing String of Text in Post Content\"}]},{\"@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":"Changing String of Text in Post Content -","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\/changing-string-of-text-in-post-content\/","og_locale":"en_US","og_type":"article","og_title":"Changing String of Text in Post Content -","og_description":"My company recently went through a name change\u2014from New York Society of Security Analysts (NYSSA) to CFA Society New York (CFANY)\u2014and I was hoping to easily change all pertinent references within event-post content accordingly. I had no luck with the below oft-referenced snippet found here: &lt;?php \/* * EXAMPLE OF CHANGING ANY TEXT (STRING) IN [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/","article_modified_time":"2017-09-19T21:01: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\/changing-string-of-text-in-post-content\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/","name":"Changing String of Text in Post Content -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-09-19T20:59:21+00:00","dateModified":"2017-09-19T21:01:40+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/changing-string-of-text-in-post-content\/#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":"Changing String of Text in Post Content"}]},{"@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\/1351453","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\/1351453\/revisions"}],"predecessor-version":[{"id":1351454,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1351453\/revisions\/1351454"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1351453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}