Created
June 23, 2017 17:28
-
-
Save chriswagoner/8b8f3a7b746a0e1f627de74cd23af9c8 to your computer and use it in GitHub Desktop.
Wordpress Replace 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
| /** FILTER THE TEXT, THEN EXECUTE A FUNCTION THAT USES THE FILTER **/ | |
| add_filter( 'gettext', 'grab_text', 20, 3 ); | |
| function grab_text( $translated_text, $text, $domain ) { | |
| if ( $translated_text == 'Barcode' ) { | |
| $translated_text = 'UPC'; | |
| } | |
| return $translated_text; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment