Hi there,
I have a site here at:
And I’m trying to translate the APPLY COUPON btn. For which, I’m trying to use this code:
add_filter( 'gettext', 'translate_x_strings', 20, 3 );
function translate_x_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Apply coupon' :
case 'Apply Coupon' :
$translated_text = __( 'Your translated text.', '__x__' );
break;
}
return $translated_text;
}
And it is not working. Could you help?
Thanks a bunch!