Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ipokkel/da6a50922956440716bf55ad07194c09 to your computer and use it in GitHub Desktop.
Save ipokkel/da6a50922956440716bf55ad07194c09 to your computer and use it in GitHub Desktop.
<?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