Created
July 3, 2019 16:59
-
-
Save dancameron/9c2f061103bec68d07bc3e095011b8fb to your computer and use it in GitHub Desktop.
Translating Strings in Sprout Invoices
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 // don't add this line, since your functions.php file already starts with it. | |
/** | |
* Example filter will translate/change the string "Description". | |
* "Description" can be changed to whatever string you'd like to translate/change | |
* just make sure to change the function name so you don't have any conflicts. | |
*/ | |
function si_change_strings( $translations, $text, $domain ) { | |
if ( 'sprout-invoices' === $domain ) { | |
// Change "Description" | |
if ( '<b>Payment Due before %s:</b> %s' === $text ) { | |
return '<b>Payment Due %s:</b> %s'; | |
} | |
// add more conditions, changing as many strings as you'd like | |
} | |
return $translations; | |
} | |
add_filter( 'gettext', 'si_change_strings', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment