Forked from ipokkel/change-text-or-translate-with-gettext.php
Last active
May 26, 2023 01:10
-
-
Save michaelbeil/fb4e0f492172e843b9c8fafdc0c30581 to your computer and use it in GitHub Desktop.
Change password reset text with the gettext filter
This file contains 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
<?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