Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change PMPro Wording on Edit Profile Page
<?php
/**
* This recipe changes the text 'Cancel' only on the Edit Profile Page because the word also appears on the Membership accounts page
* This should be added to a PMPro Customizations or Code Snippets Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Thank you to Ronald, for assisting in writing this snippet.
**/
function pmpro_init_cancel_gettext() {
add_filter( 'gettext', 'pmpro_change_cancel_text_gettext', 10, 3 );
}
add_action( 'init', 'pmpro_init_cancel_gettext' );
function pmpro_change_cancel_text_gettext( $translated_text, $text, $domain ) {
if ( is_page( 'your-profile' ) && 'paid-memberships-pro' === $domain ) {
if ( 'Cancel' === $text ) {
return 'Cancel Membership';
}
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.