Date header term in Map View is same as field placeholder

Home Forums Additional Help Translations Date header term in Map View is same as field placeholder

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #225391
    irishrunner16
    Participant

    By default, Map View uses the same “Date” term for that field’s header and placeholder. Thus, it is not possible to use a translation to change that term (for example, to something like “Events on or After”), because it also changes the date field placeholder for all of the views (which is also “Date”).

    A workaround is to update line 4250 in /lib/the-events-calendar.class.php with the desired term:
    $caption = __('Events on or After', 'tribe-events-calendar');

    Its not a big deal, but to avoid having to edit this file to just make a one term change, could a new term be added to the POT file in a future release?

    Sorry for posting this here…I just didn’t want to use one of my UserVoice “votes” on this minor request. Either way, thanks for taking it into consideration and thanks for such a great suite of plugins!

    Sean

    #230303
    Leah
    Member

    Hi Sean,

    Thanks for posting. I’ll need to check in with one of our devs about this, but I’ll get back to you. I’m glad you have a workaround in the interim.

    Best,

    Leah

    #231931
    Leah
    Member

    Hi Sean,

    Thanks for your patience. I chatted with our developer, and she said that you can use a filter to do this. You’ll want to filter

    'tribe_bar_datepicker_caption'

    and check

    tribe_is_map

    and then put in your custom text for Map View.

    I hope that helps! Lemme know if it doesn’t work out.

    Best,
    Leah

    #561702
    irishrunner16
    Participant

    Hi Leah,
    Thanks for checking on this. I gave this a shot but I’m unfortunately not familiar with creating such a function, so I haven’t gotten this to work. If you have a chance, would you be able to let me know the snippet that I should put in my functions.php file?
    Thank you,
    Sean

    #581214
    Barry
    Member

    Hi Sean!

    The basic shape of a function to do this would be something like:

    add_filter( 'tribe_bar_datepicker_caption', 'change_datepicker_caption_in_map_view' );
    
    function change_datepicker_caption_in_map_view( $text ) {
    	if ( ! tribe_is_map() ) return $text;
    	return 'My custom caption';
    }

    Does that help?

    #591581
    irishrunner16
    Participant

    Thanks Barry, that was a huge help! This will help me for making similar tweaks in the future. Really appreciate it!

    #597334
    Barry
    Member

    Happy to help!

    I’ll go ahead and close the thread out, but as ever feel free to create new ones if we can assist with anything else. Thanks again!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Date header term in Map View is same as field placeholder’ is closed to new replies.