try this snippet
function my_em_text_rewrites($translation, $orig, $domain) {
switch ($orig) {
case 'All Day' :
$translation = 'Times vary';
break;
}
return $translation;
}
add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );
As for where to paste this : http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
Thanks for the detailed instructions Angelo. The only drawback I see is that this would also change “All Day” elsewhere on the site if the users happened to type that, right? I just want to change it on the events listing:
http://www.slccsing.org/events/
That’s why my first instinct was to change it in the Language file. I realize that could be overwritten by future updates.
I uploaded the code as a plug-in, but it hasn’t changed anything: http://www.slccsing.org/events/.
Do I need to define the $domain value somewhere?
Thanks,
Brian
Hiya,
That code would not change any user-entered text, no.
Have you tried the code in functions.php first? That code works for me which suggests your plugin implementation of it is broken somehow.
Thanks,
Phil
Hi Phil,
Sorry for the delay. I added the code in functions.php, and I’m still seeing “All Day” instead of “Times vary.” http://www.slccsing.org/events/
Do I need to change anything in the code – e.g. $domain or can I just copy and paste it?
I don’t know if it makes a difference, but we’re using Events Manager Pro.
Thanks,
Brian
you can use conditional placeholder {all_day}content{/all_day} for this one at Events > Settings > Formatting > Events > Default event list format
eg.
{all_day} Times vary {/all_day}
{is_long} #_EVENTDATES {/is_long}
{not_long} #_EVENTDATES {/not_long}
http://wp-events-plugin.com/documentation/conditional-placeholders/
Thanks Angelo,
That’s a more elegant solution, and it gets me closer: http://www.slccsing.org/events/.
However, {not_all_day} doesn’t seem to be a valid placeholder. Because events checked for “All Day” may be “long” or “not long,” I can’t figure out a way to remove “All Day” from the display.