Skip to content

Instantly share code, notes, and snippets.

@ahmedeshaan
Created December 5, 2021 11:14
Show Gist options
  • Save ahmedeshaan/b24f0ba03c9ed38665ef6bf34bcd0b77 to your computer and use it in GitHub Desktop.
Save ahmedeshaan/b24f0ba03c9ed38665ef6bf34bcd0b77 to your computer and use it in GitHub Desktop.
add_filter('gettext', 'change_rp_text', 10, 3);
add_filter('ngettext', 'change_rp_text', 10, 3);
function change_rp_text($translated, $text, $domain)
{
if ($text === 'Related products' && $domain === 'woocommerce') {
$translated = esc_html__('Check out our other products', $domain);
}
return $translated;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment