Created
May 22, 2024 09:51
-
-
Save ipokkel/da6a50922956440716bf55ad07194c09 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Change the gettext strings on the PMPro member profile edit and checkout pages. | |
* | |
* 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 gettext_pmpro_profile_checkout_pages( $translated_text, $text, $domain ) { | |
global $pmpro_pages; | |
if ( ! empty( $pmpro_pages ) && ( is_page( $pmpro_pages['checkout'] ) || is_page( $pmpro_pages['member_profile_edit'] ) ) && 'paid-memberships-pro' === $domain ) { | |
switch ( $text ) { | |
case 'Email': | |
$translated_text = 'Business Email'; | |
break; | |
case 'Email Address': | |
$translated_text = 'Business Email'; | |
break; | |
case 'Confirm Email Address': | |
$translated_text = 'Confirm Business Email'; | |
break; | |
} | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'gettext_pmpro_profile_checkout_pages', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment