Home › Forums › Additional Help › Translations › Date header term in Map View is same as field placeholder
- This topic has 6 replies, 3 voices, and was last updated 9 years, 9 months ago by Barry.
-
AuthorPosts
-
June 14, 2014 at 7:26 am #225391irishrunner16Participant
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
June 16, 2014 at 5:35 pm #230303LeahMemberHi 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
June 17, 2014 at 3:04 pm #231931LeahMemberHi 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,
LeahAugust 1, 2014 at 6:35 pm #561702irishrunner16ParticipantHi 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,
SeanAugust 4, 2014 at 3:35 pm #581214BarryMemberHi 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?
August 5, 2014 at 6:04 pm #591581irishrunner16ParticipantThanks Barry, that was a huge help! This will help me for making similar tweaks in the future. Really appreciate it!
August 6, 2014 at 9:51 am #597334BarryMemberHappy 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!
-
AuthorPosts
- The topic ‘Date header term in Map View is same as field placeholder’ is closed to new replies.