-
-
Save Pebblo/8c246686e45ade7bc69388d47de22522 to your computer and use it in GitHub Desktop.
An example of how to alter translations using the gettext_with_context filter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Please do not include the opening PHP tag if you already have one. | |
function tw_ee_gettext_with_context( $translated, $text, $context, $domain ) { | |
if ( 'event_espresso' == $domain ) { | |
if ( '(For %1$s)' == $text && '(For Event Name)' == $context ) { | |
$translated = '(%1$s)'; //Remove the 'For' | |
} | |
} | |
return $translated; | |
} | |
add_filter( 'gettext_with_context', 'tw_ee_gettext_with_context', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reference:
https://eventespresso.com/topic/event-name-in-invoice-an-registration/
https://eventespresso.com/topic/line_item_description-edit-the-text/#post-229358