Skip to content

Instantly share code, notes, and snippets.

@grantalltodavid
Last active July 16, 2018 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantalltodavid/a0a45b6f8e214fbc1f9ef6d902318ef3 to your computer and use it in GitHub Desktop.
Save grantalltodavid/a0a45b6f8e214fbc1f9ef6d902318ef3 to your computer and use it in GitHub Desktop.
WooCommerce - how to translate/change text labels
add_filter( 'gettext', 'custom_translate_woocommerce_20180716', 10, 3 );
function custom_translate_woocommerce_20180716 ( $translated_text, $text, $domain ) {
if ( $domain === 'woocommerce' && $translated_text === 'Payment method:' ) {
$translated_text = 'Options:';
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment