Created
August 12, 2019 07:34
-
-
Save deeman/0573ea09892accf7fd39a1bb8177d443 to your computer and use it in GitHub Desktop.
WooCommerce Gettext Translations
This file contains hidden or 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
| ** | |
| * 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 'Sale!' : | |
| $translated_text = __( 'Clearance!', 'woocommerce' ); | |
| break; | |
| case 'Add to cart' : | |
| $translated_text = __( 'Add to basket', 'woocommerce' ); | |
| break; | |
| case 'Related Products' : | |
| $translated_text = __( 'Check out these related products', '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