Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michaelbeil/fb4e0f492172e843b9c8fafdc0c30581 to your computer and use it in GitHub Desktop.
Save michaelbeil/fb4e0f492172e843b9c8fafdc0c30581 to your computer and use it in GitHub Desktop.
Change password reset text with the gettext filter
<?php
/**
* This recipe changes text with the gettext filter.
* Can be used to change text or translate specific text strings.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function change_text_or_translate_with_gettext ( $translated, $text, $domain ) {
switch ( $domain ) {
case 'paid-memberships-pro':
switch ( $text ) {
case 'Check your email for the confirmation link, then visit the login page.':
$translated = 'If that account exists in our system, then we will send a password reset link.';
break;
}
}
return $translated;
}
add_filter( 'gettext', 'change_text_or_translate_with_gettext', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment