Created
April 1, 2025 12:34
-
-
Save ipokkel/793001c8bd4ca176702cdb8e076957b9 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 | |
/** | |
* 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