Events Pro- Map view

Home Forums Calendar Products Events Calendar PRO Events Pro- Map view

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1159730
    Kate
    Participant

    Hi- Is there a way to change the pin tag in the map from “Event” to somethings else? I have tried in the functions.php but that worked for everything else apart from the map?

    #1160006
    Cliff
    Member

    Hi Kate. Could you please provide a link to the code snippet you’re using and to your site’s Map View and an annotated screenshot of what you’re seeing there (the “Event” not changing text so I know where to look on your site)?

    #1160095
    Kate
    Participant

    Thanks Cliff,
    he screen shot is below, and I have just used the below in functions php (which works everywhere I want it to apart from the map):

    /*
    * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
    * See the codex to learn more about WP text domains:
    * http://codex.wordpress.org/Translating_WordPress#Localization_Technology
    * Example Tribe domains: ‘tribe-events-calendar’, ‘tribe-events-calendar-pro’…
    */
    function tribe_custom_theme_text ( $translations, $text, $domain ) {

    // Put your custom text here in a key => value pair
    // Example: ‘Text you want to change’ => ‘This is what it will be changed to’
    // The text you want to change is the key, and it is case-sensitive
    // The text you want to change it to is the value
    // You can freely add or remove key => values, but make sure to separate them with a comma
    // This example changes the label “Venue” to “Location”, and “Related Events” to “Similar Events”
    $custom_text = array(
    ‘Events’ => ‘Classes’,
    ‘Event’ => ‘Class’,
    ‘Recurring %s’ => ‘Other class dates available’,
    ‘Show Filters’ => ‘Refine your search’,
    );

    // If this text domain starts with “tribe-“, “the-events-“, or “event-” and we have replacement text
    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);

    #1160356
    Cliff
    Member

    Kate, thanks for sharing. I see you started with the snippet from https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/ and customized it for your needs, which is great.

    The map tooltip you’re trying to re-word is from Line 1188 of /wp-content/plugins/events-calendar-pro/src/Tribe/Main.php

    You’ll need to add Event: (with the trailing space after the colon) to your list of strings to replace.

    So you could add this to your list of strings to replace: 'Event: ' => 'Class: ',

    I hope this answers your question!

    #1169865
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Events Pro- Map view’ is closed to new replies.