Created
January 13, 2020 10:19
-
-
Save andrewlimaza/20095c655ef7804013443ea581d3f61c to your computer and use it in GitHub Desktop.
Adjust Confirmation Message When Purchasing Addon Packages Item [Paid Memberships Pro]
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 | |
/** | |
* Adjust the confirmation message when someone purchases an item from Addon Packages. | |
* Remove default message and create own messaage on lines 18-19. | |
* Add code following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// Remove default Addon Packages Message. | |
remove_filter( 'pmpro_confirmation_message', 'pmproap_pmpro_confirmation_message' ); | |
function change_confirmation_message_addon_packages( $message ) { | |
if ( ! empty( $_REQUEST['ap'] ) ) { | |
$message = ''; | |
$ap = $_REQUEST['ap']; | |
$ap_post = get_post( $ap ); | |
$message .= "<p>Thank you applying for accreditation. We look forward to receiving your supporting evidence.</p>"; | |
$message .= '<p class="pmproap_confirmation">' . sprintf( __( 'Continue on to %s.', 'pmproap' ), '<a href="' . get_permalink( $ap_post->ID ) . '">' . $ap_post->post_title . '</a>' ) . '</p>'; | |
} | |
return $message; | |
} | |
add_filter( 'pmpro_confirmation_message', 'change_confirmation_message_addon_packages', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment