Code-Snippets-Functions/Execute a function on a child site/WooCommerce/edit-text-strings-order-emails.txt

9 lines
599 B
Text

add_filter( 'gettext', 'wc_translate_woocommerce_strings_emails', 9999, 3 );
function wc_translate_woocommerce_strings_emails( $translated, $untranslated, $domain ) {
if ( 'woocommerce' === $domain ) {
$translated = str_ireplace( 'Hi %s,', '', $untranslated ); // HIDE
$translated = str_ireplace( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'Your payment was successful and we are now getting ready for shipping. Expect another email from us with tracking details soon!', $untranslated ); // EDIT
}
return $translated;
}