Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created January 13, 2020 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/20095c655ef7804013443ea581d3f61c to your computer and use it in GitHub Desktop.
Save andrewlimaza/20095c655ef7804013443ea581d3f61c to your computer and use it in GitHub Desktop.
Adjust Confirmation Message When Purchasing Addon Packages Item [Paid Memberships Pro]
<?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