Skip to content

Instantly share code, notes, and snippets.

@pbrocks
Last active March 9, 2018 00:27
Show Gist options
  • Save pbrocks/256d77a08451b6945eaf3e517b4aa561 to your computer and use it in GitHub Desktop.
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.
/**
* 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