Hello, I am trying to change the text “View all categories” in the category dropdown filter. I need it to say, “All Courtrooms”. I found where someone asked this question and they were pointed to the codex reference site, but to be honest, I need some help figuring that out. Really, I only need to change the words in that dropdown. I don’t even care to change the taxonomy on the backend. Just what the user sees on the calendar. I purchased the pro license just so that I could ask this only question.
Thank you!
Bryan Buckles
Hi Bryan,
The most straightforward solution is probably to use the translation filters, e.g. the following added to a mu-plugin
or a theme’s functions.php
(see https://wp-event-organiser.com/blog/tutorial/where-should-i-put-code-from-the-tutorials/) should work:
add_filter('gettext', function($translated_text, $untranslated_text, $domain){
if($domain === 'eventorganiser' && $untranslated_text === 'View all categories') {
$translated_text = 'All Courtrooms';
}
return $translated_text;
}, 20, 3);
and should change the text everywhere.
Stephen Harris
That did it! Thank you! Just to be clear, this will only affect the text that reads “View all categories’ that is attached to the Event Organiser calendar correct? Meaning, it won’t change the text if ‘View all categories’ is found in a different part of the website?
Bryan Buckles
It will change every instance of ‘View all categories’ used by the Event Organiser. So it won’t impact post categories or any other pug-in, but its not limited to just the calendar (e.g. it’ll change the text in the filter on the events admin page).
Stephen Harris