Skip to content

Instantly share code, notes, and snippets.

@eder-dias
Forked from simonlk/wordpress-text-change
Created May 3, 2017 03:47
Show Gist options
  • Save eder-dias/510c008c40eeb60f9a5fe17facd9bb7f to your computer and use it in GitHub Desktop.
Save eder-dias/510c008c40eeb60f9a5fe17facd9bb7f to your computer and use it in GitHub Desktop.
Change any text string in WordPress & WooCommerce
function wc_translate_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Like this? Try these:', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_translate_strings', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment