Created
March 11, 2020 12:39
-
-
Save pavr0m/d544db4a80f41e7e651871fdca9cbbf4 to your computer and use it in GitHub Desktop.
Wordpress. Change text using gettext function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'gettext', 'change_woocommerce_return_to_shop_text', 20, 3 ); | |
function change_woocommerce_return_to_shop_text( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Return to cart' : | |
$translated_text = __( 'Back to Shop', 'woocommerce' ); | |
case 'Return to basket' : | |
$translated_text = __( 'Back to Shop', 'woocommerce' ); | |
break; | |
} | |
return $translated_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment