Skip to content

Instantly share code, notes, and snippets.

@deeman
Created August 12, 2019 07:31
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 deeman/86fac7b38dc8060eb546f63a3e9bbe2c to your computer and use it in GitHub Desktop.
Save deeman/86fac7b38dc8060eb546f63a3e9bbe2c to your computer and use it in GitHub Desktop.
Rename Related Products Tab in WooCommerce
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Your custom text here', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment