Last active
April 21, 2018 09:21
-
-
Save janzikmund/5c1a0287f664aff69c3eedc247ab8a88 to your computer and use it in GitHub Desktop.
WordPress gettext filter
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
<?php | |
// custom text translations | |
add_filter( 'gettext', function( $translated_text, $text, $domain ) { | |
$translations = array( | |
'qode' => array( | |
'view' => 'read more', | |
), | |
'wpgmp_google_map' => array( | |
'Enter address or latitude or longitude or title or city or state or country or postal code here...' => 'Suburb, Town, City' | |
), | |
); | |
if ( isset($translations[$domain][$translated_text]) ) { | |
return $translations[$domain][$translated_text]; | |
} | |
return $translated_text; | |
}, 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment