Last active
March 9, 2018 00:27
-
-
Save pbrocks/256d77a08451b6945eaf3e517b4aa561 to your computer and use it in GitHub Desktop.
Get text filter that replaces text strings with a string customized by the administrator.
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
/** | |
* Testing if this is synced or embedded | |
* | |
*/ | |
add_filter( 'gettext', 'my_pmpro_gettext_changes', 20, 3 ); | |
function my_pmpro_gettext_changes( $translated_text, $text, $domain ) { | |
$original = 'Drag and drop membership levels to reorder them on the Levels page.'; | |
$replacement = 'Whatever I want to replace that text with'; | |
$text_domain = 'paid-memberships-pro'; | |
if ( $text_domain === $domain ) { | |
$translated_text = str_replace( $original, $replacement, $translated_text ); | |
} | |
return $translated_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment