Changing the words 'Now' & 'onward' to just the single word 'Dates' in The Events Calendar

I am trying to change 'Now onwards' to just 'Dates'. Something similar was done on: I use the events Calendar Plugin and I want to change some words

When I used Kevin's snippet, from the link above, I could not get it to replace both 'Now' and 'Onwards'.

How can I get it to replace both of those words?

This is what I have so far:

function example_gettext_with_context( $translated, $text ) {
if ( 'Now' == $text ) {
      $translated = 'Dates';
 }
   return $translated;
}
add_filter( 'gettext_with_context', 'example_gettext_with_context', 10, 2 );

I have already tries the plugin Say What and that didnt work.

I have also already tried the Events Calendar solution that is posted at: https://theeventscalendar.com/knowledgebase/k/change-the-wording-of-any-bit-of-text-or-string/ But it did not work either

Topic the-events-calendar Wordpress

Category Web


It appears that The Events Calendar has changed "Now Onwards" to "Upcoming" on their own. This problem is now irrelevant.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.