Last active
August 14, 2021 02:12
-
-
Save femiyb/253535512d0df7165d4cd7f9716c25f5 to your computer and use it in GitHub Desktop.
Adjust Confirmation Message
This file contains hidden or 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 | |
/** | |
* This changes the default confirmation message when a user checks out. | |
* | |
* 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/ | |
*/ | |
// remove the default confirmation text | |
remove_filter( 'pmpro_confirmation_message', 'pmpro_pmpro_confirmation_message' ); | |
// add new confirmation text | |
function my_pmpro_confirmation_message( $message ) { | |
$message = ''; | |
$message .= "<p>This is a new confirmation message.</p>"; | |
return $message; | |
} | |
add_filter( 'pmpro_confirmation_message', 'my_pmpro_confirmation_message', 10, 1 ); |
Thanks, this was very helpful! For whatever reason, priority 10 was not working for me. I switched it to 20 and worked perfectly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "How to customize the default confirmation message shown to new members." at Paid Memberships Pro here: https://www.paidmembershipspro.com/custom-confirmation-page-content/