Skip to content

Instantly share code, notes, and snippets.

@melvinstanly
Created October 22, 2018 04:26
Show Gist options
  • Save melvinstanly/9611a8d3d5ffebe989119cb06866da89 to your computer and use it in GitHub Desktop.
Save melvinstanly/9611a8d3d5ffebe989119cb06866da89 to your computer and use it in GitHub Desktop.
Functions using the get_text filter
function custom_wc_translations( $translated_text, $text, $domain ) {
if(is_checkout()){
switch ($translated_text) {
case 'Replaceble_text' :
$translated_text = __('String to Replace', 'Domain');
break;
}
}
return $translated_text;
}
add_filter( 'gettext', 'custom_wc_translations', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment