{"id":1945823,"date":"2020-02-13T11:46:49","date_gmt":"2020-02-13T16:46:49","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1945823"},"modified":"2026-04-02T17:32:18","modified_gmt":"2026-04-02T21:32:18","slug":"change-the-get-tickets-link-label","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/change-the-get-tickets-link-label\/","title":{"rendered":"Change the \u201cGet Tickets\u201d Link Text on Calendar Views"},"content":{"rendered":"\n<p>With <a href=\"https:\/\/theeventscalendar.com\/products\/wordpress-event-tickets\/\" target=\"_blank\" rel=\"noreferrer noopener\">Event Tickets and Event Tickets Plus<\/a>, events with tickets have a &#8220;Get Tickets&#8221; link that appears by default in certain places on the calendar, like list view:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/knowledgebase\/wp-content\/uploads\/2020\/02\/get-tickets-v2-1024x615.png\" alt=\"\" class=\"wp-image-1946048\"\/><\/figure>\n\n\n\n<p>There&#8217;s one in the event view as well:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/knowledgebase\/wp-content\/uploads\/2020\/02\/get-tickets-v2-kb-single-1024x456.png\" alt=\"\" class=\"wp-image-1945827\"\/><\/figure>\n\n\n\n<p>Let&#8217;s say we want that to say something else, like &#8220;Register Now!&#8221; or something. Here&#8217;s a snippet that you can use to change the link text to whatever works best for your site:<\/p>\n\n\n\n<p>Change &#8220;Register Now!&#8221; in this example to anything that you would like, then add this snippet to the `functions.php` file of your <a href=\"https:\/\/developer.wordpress.org\/themes\/advanced-topics\/child-themes\/\" target=\"_blank\" rel=\"noreferrer noopener\">child theme<\/a>, or by using the <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\" target=\"_blank\" rel=\"noreferrer noopener\">Code Snippets<\/a> plugin.<\/p>\n\n\n\n<p><strong>PHP 7.4 version<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/**\n * Change the Get Tickets on List View and Single Events\n *\n * @param string $translation The translated text.\n * @param string $text        The text to translate.\n * @param string $context     The option context string.\n * @param string $domain      The domain slug of the translated text.\n *\n * @return string The translated text or the custom text.\n *\/\n\nadd_filter( &#039;gettext_with_context&#039;, &#039;tribe_change_get_tickets&#039;, 20, 4 );\nfunction tribe_change_get_tickets( $translation, $text, $context = &quot;&quot; , $domain ) {\n\n\tif ( \n\t     $domain != &#039;default&#039;\n\t     &amp;&amp; strpos( $domain, &#039;event-&#039; ) !== 0\n\t) {\n\t\treturn $translation;\n\t}\n\n\t$ticket_text = &#x5B;\n\t\t\/\/ Get Tickets on List View\n\t\t&#039;Get %s&#039;      =&gt; &#039;Register Now!&#039;,\n\t\t\/\/ Get Tickets Form - Single View\n\t\t&#039;Get Tickets&#039; =&gt; &#039;Register Now!&#039;,\n\t];\n\n\t\/\/ If we don&#039;t have replacement text, bail.\n\tif ( empty( $ticket_text&#x5B; $text ] ) ) {\n\t\treturn $translation;\n\t}\n\n\treturn $ticket_text&#x5B; $text ];\n}\n<\/pre><\/div>\n\n\n<p><strong>PHP 8.x version<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/**\n * Change the Get Tickets on List View and Single Events\n *\n * @param string $translation The translated text.\n * @param string $text        The text to translate.\n * @param string $context     The option context string.\n * @param string $domain      The domain slug of the translated text.\n *\n * @return string The translated text or the custom text.\n *\/\n\nadd_filter( &#039;gettext_with_context&#039;, &#039;tribe_change_get_tickets&#039;, 20, 4 );\nfunction tribe_change_get_tickets( string $translation, string $text, string $context, string $domain ): string {\n\n\tif (\n\t\t$domain != &#039;default&#039;\n\t\t&amp;&amp; ! str_starts_with( $domain, &#039;event-&#039; )\n\t) {\n\t\treturn $translation;\n\t}\n\n\t$ticket_text = &#x5B;\n\t\t\/\/ Get Tickets on List View\n\t\t&#039;Get %s&#039;      =&gt; &#039;Register Now!&#039;,\n\t\t\/\/ Get Tickets Form - Single View\n\t\t&#039;Get Tickets&#039; =&gt; &#039;Register Now!&#039;,\n\t];\n\n\t\/\/ If we don&#039;t have replacement text, bail.\n\tif ( empty( $ticket_text&#x5B; $text ] ) ) {\n\t\treturn $translation;\n\t}\n\n\treturn $ticket_text&#x5B; $text ];\n}\n<\/pre><\/div>\n\n\n<p>Note, <code>$context<\/code> and <code>$domain<\/code> parameters are not used in the above example, so they can be omitted. If so, remember to change the number of parameters from 4 to 2 when applying the filter.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Event Tickets and Event Tickets Plus, events with tickets have a &#8220;Get Tickets&#8221; link that appears by default in certain places on the calendar, like list view: There&#8217;s one in the event view as well: Let&#8217;s say we want that to say something else, like &#8220;Register Now!&#8221; or something. Here&#8217;s a snippet that you&#8230;<\/p>\n","protected":false},"author":84,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[79],"tags":[25,58],"stellar-product-taxonomy":[155,156],"class_list":["post-1945823","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippets","tag-customizations","tag-php","stellar-product-taxonomy-event-tickets","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":79,"label":"Snippets"}],"post_tag":[{"value":25,"label":"Customizations"},{"value":58,"label":"PHP"}],"stellar-product-taxonomy":[{"value":155,"label":"Event Tickets"},{"value":156,"label":"Event Tickets Plus"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"The Events Calendar Team","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/the_events_calendar_team\/"},"comment_info":0,"category_info":[{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":80,"filter":"raw","term_order":"0","cat_ID":79,"category_count":80,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":[{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":102,"filter":"raw","term_order":"0"},{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":78,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1945823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1945823"}],"version-history":[{"count":3,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1945823\/revisions"}],"predecessor-version":[{"id":1968451,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1945823\/revisions\/1968451"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1945823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1945823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1945823"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1945823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}