Skip to content

Instantly share code, notes, and snippets.

@bagerathan
Last active August 22, 2021 15:18
Show Gist options
  • Save bagerathan/67f08729611e3a76155a16fa21c67fe3 to your computer and use it in GitHub Desktop.
Save bagerathan/67f08729611e3a76155a16fa21c67fe3 to your computer and use it in GitHub Desktop.
[Change any string in WooCommerce] #woo
add_filter( 'gettext', 'maxpapi_translate_woocommerce_strings', 999, 3 );
function maxpapi_translate_woocommerce_strings( $translated, $untranslated, $domain ) {
if ( ! is_admin() && 'woocommerce' === $domain ) {
switch ( $translated ) {
case 'Weight':
$translated = 'Shipping Weight';
break;
case 'Dimensions':
$translated = 'Shipping Dimensions';
break;
}
}
return $translated;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment