Home › Forums › Calendar Products › Events Calendar PRO › Change Event Categories title in WP admin
- This topic has 8 replies, 3 voices, and was last updated 9 years, 9 months ago by
Colleen.
-
AuthorPosts
-
July 8, 2016 at 12:04 pm #1137483
Colleen
ParticipantI’m wondering if there is a function I can use to change the default “Event Categories” title to something else on the wp-admin side (in the meta box). I have been searching and found a way to change the title in output on the template of the actual site, but I need backend help. Anything you can do to point me in the right direction would be much appreciated!
July 11, 2016 at 7:11 am #1138083Nico
MemberHowdy Colleen,
Welcome to our support forums and thanks for reaching out to us!
Have you tried with the snippet in this knowledge base article: Change the wording of any bit of text or string ? It will change all occurrences of the matched text so might not fit if you are only looking for to change it in the back-end. If that’s the case plase let me know and I’ll try to adapt the snippet to just affect the back-end.
Hope you have a great week,
Best,
NicoJuly 11, 2016 at 7:23 am #1138091Colleen
ParticipantHi Nico,
Thanks for getting back to me! I am looking for just a back-end change only, not the every instance. Any direction you can provide would be awesome. Thanks so much!
Colleen
July 12, 2016 at 2:32 pm #1138872Nico
MemberHey Colleen,
Please past the snippet below in your theme’s (or child theme’s) functions.php file:
/* Tribe change translation string in the back-end */
function tribe_custom_theme_text ( $translations, $text, $domain ) {if ( !is_admin() ) return $text;
$custom_text = array(
'%s Categories' => '%s Taxonomy',
);if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($text, $custom_text) ) {
$text = $custom_text[$text];
}return $text;
}
add_filter('gettext', 'tribe_custom_theme_text', 20, 3);
Change %s Taxonomy for your custom translation and check to see if it works!
Best,
NicoJuly 12, 2016 at 2:44 pm #1138879Colleen
ParticipantShoot! That didn’t seem to do it. I have the snippet in my theme’s function.php file and I changed out
%s Taxonomyto justtestbut no luck on changing the title of the meta box.Colleen
-
This reply was modified 9 years, 9 months ago by
Colleen.
July 13, 2016 at 2:16 pm #1139356Nico
MemberThanks for following up!
I just tested this locally (changing ‘%s Taxonomy’ for ‘test’) and I can see it working as expected: https://cloudup.com/cOrpDeCTTNz – on the menu and on the metabox title. There are other translations that are not changed like ‘+ Add New Event Category’, but those are different translation strings. Are you referring to these ones or you are not seeing any change at all?
Also, are you sure the script is in the correct functions.php file? If you use the example on this article: Change the wording of any bit of text or string does it work as expected?
Please let me know about it,
Best,
NicoJuly 14, 2016 at 9:27 am #1139706Colleen
ParticipantHi Nico,
So sorry for the confusion on my end– I completely goofed. The solution DOES work; I just didn’t have the pro version active on my test site. I was only using the free version of The Events Calendar. I activated the pro version and it worked like a charm!
Thanks again for all of your help with this one,
ColleenJuly 14, 2016 at 9:38 am #1139780Nico
MemberStocked to hear Colleen and glad to be of service 🙂
I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.
Best,
Nico -
This reply was modified 9 years, 9 months ago by
-
AuthorPosts
- The topic ‘Change Event Categories title in WP admin’ is closed to new replies.
