Skip to content

Instantly share code, notes, and snippets.

@vikastyagi87
Last active July 20, 2020 18:43
Show Gist options
  • Save vikastyagi87/050aac9409e2ddd7c28971393922d572 to your computer and use it in GitHub Desktop.
Save vikastyagi87/050aac9409e2ddd7c28971393922d572 to your computer and use it in GitHub Desktop.
Replace some WooCommerce text
/**
* filter translations, to replace some WooCommerce text with our own
* @param string $translation the translated text
* @param string $text the text before translation
* @param string $domain the gettext domain for translation
* @return string
*/
function replace_some_woocommerce_text($translation, $text, $domain) {
switch ($text) {
case 'Direct bank transfer':
$translation = 'Payme';
break;
}
return $translation;
}
add_filter('gettext', 'replace_some_woocommerce_text', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment