Created
April 22, 2022 08:19
-
-
Save bradleysa/fad71d9b129614a404e3a6dcc44134b9 to your computer and use it in GitHub Desktop.
WC: Change Text "You may be interested in…" & "Related Products"
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
add_filter( 'gettext', 'bbloomer_translate_woocommerce_strings', 999, 3 ); | |
function bbloomer_translate_woocommerce_strings( $translated, $untranslated, $domain ) { | |
if ( ! is_admin() && 'woocommerce' === $domain ) { | |
switch ( $translated ) { | |
case 'You may be interested in…': | |
$translated = 'Add Another Delicious Jam 😋'; | |
break; | |
case 'Related products': | |
$translated = 'More Delicious Jams 😋'; | |
break; | |
// ETC | |
} | |
} | |
return $translated; | |
} | |
/** https://www.businessbloomer.com/translate-single-string-woocommerce-wordpress/ **/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment