Created
July 28, 2022 08:49
-
-
Save JarrydLong/97bccf1c0cdaf0d062eb7e75eeea65fa 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 //do not copy | |
/** | |
* This recipe will remove the confirmation messages from Sponsored Members on checkout and email | |
* when a member pays by check. Only once payment has been received will the codes show. | |
* | |
* 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 mypmpro_sm_remove_confirmation_messages(){ | |
$morder = new MemberOrder(); | |
$morder->getLastMemberOrder( null, '' ); | |
if( $morder->status == 'pending' && $morder->gateway == 'check' ) { | |
remove_filter( 'pmpro_confirmation_message', 'pmprosm_pmpro_confirmation_message' ); | |
remove_filter( "pmpro_email_body", "pmprosm_pmpro_email_body", 10, 2 ); | |
} | |
} | |
add_action( 'init', 'mypmpro_sm_remove_confirmation_messages' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This did not seem to work on the
init
hook, but changing that topmpro_after_checkout
worked as expected