Created
May 16, 2018 15:06
-
-
Save djrmom/19bd4467fb1e2878d11e5983c31317cf to your computer and use it in GitHub Desktop.
facetwp change text by translating
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
| <?php | |
| /** example of changing a text string using wp's gettext filter **/ | |
| add_filter( 'gettext', function ( $translated_text, $untranslated_text, $domain ) { | |
| if ( $translated_text == 'Enter location' && 'fwp' == $domain ) { | |
| $translated_text = 'Other text'; | |
| } | |
| return $translated_text; | |
| }, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment