Change the View all Categories Text in Dropdown

WordPress Event Management, Calendars & Registration Forums General Question Change the View all Categories Text in Dropdown

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 2 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36840

    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
    #36860

    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
    #36862

    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
    #36887

    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
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.