Created
October 28, 2018 01:45
-
-
Save tradesouthwest/3271b680db9fe000bf0d90d780e0c550 to your computer and use it in GitHub Desktop.
gettext example for wordpress to replace translated text
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
add_filter( 'gettext', 'misha_change_text_with_gettext', 20, 3 ); | |
function misha_change_text_with_gettext( $translated_text, $text, $domain ) { | |
if ( is_admin() | |
&& isset($_GET['post']) | |
&& get_post_type( $_GET['post'] ) == 'shop_order' | |
&& $domain == 'woocommerce' ) { | |
if( $translated_text == 'Shipping' ) { | |
$translated_text = 'Delievery'; | |
} | |
} | |
return $translated_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment