Skip to content

Instantly share code, notes, and snippets.

@bradleysa
Created April 22, 2022 08:19
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 bradleysa/fad71d9b129614a404e3a6dcc44134b9 to your computer and use it in GitHub Desktop.
Save bradleysa/fad71d9b129614a404e3a6dcc44134b9 to your computer and use it in GitHub Desktop.
WC: Change Text "You may be interested in…" & "Related Products"
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