Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ipokkel/793001c8bd4ca176702cdb8e076957b9 to your computer and use it in GitHub Desktop.
Save ipokkel/793001c8bd4ca176702cdb8e076957b9 to your computer and use it in GitHub Desktop.
<?php
/**
* Remove or change the "Your current membership level of %s will be removed when you complete your purchase."
* text from the checkout page.
*
* 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 my_custom_pmpro_remove_existing_level_text( $translated_text, $text, $domain ) {
if ( $domain == 'paid-memberships-pro' && $text == 'Your current membership level of %s will be removed when you complete your purchase.' ) {
// Set your custom string here. To remove the text and show nothing, return an empty string, e.g. return '';
return '';
}
return $translated_text;
}
add_filter( 'gettext', 'my_custom_pmpro_remove_existing_level_text', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment