Created
October 9, 2020 15:33
-
-
Save ipokkel/b61e2afbcf5945583dfe15f61738b5ab to your computer and use it in GitHub Desktop.
This recipe is an example of how to change and translate localized text strings for PMPro.
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 is an example of how to change and translate localized text strings | |
* for PMPro. | |
* | |
* 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/ | |
*/ | |
/** | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function my_pmpro_text_strings( $translated_text, $text, $domain ) { | |
switch ( $text ) { | |
case 'Country': | |
/* translators: a title above the login input field */ | |
$translated_text = __( 'Your Translation Here', 'paid-memberships-pro' ); | |
break; | |
case 'Email Address': | |
$translated_text = __( 'Your Translation Here', 'paid-memberships-pro' ); | |
break; | |
case 'Confirm Email': | |
$translated_text = __( 'Your Translation Here', 'paid-memberships-pro' ); | |
break; | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'my_pmpro_text_strings', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment