Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created May 16, 2018 15:06
Show Gist options
  • Select an option

  • Save djrmom/19bd4467fb1e2878d11e5983c31317cf to your computer and use it in GitHub Desktop.

Select an option

Save djrmom/19bd4467fb1e2878d11e5983c31317cf to your computer and use it in GitHub Desktop.
facetwp change text by translating
<?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