From b573f295c63500fce76e52c1a496441c8e71ff9b Mon Sep 17 00:00:00 2001 From: David Parker Date: Wed, 14 Jun 2023 13:28:42 -0400 Subject: [PATCH] No longer pulling level from $_REQUEST --- includes/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index e407f20..c90af54 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -250,14 +250,14 @@ function pmpromc_pmpro_checkout_before_change_membership_level() { * * @param int $user_id of user who checked out. */ -function pmpromc_pmpro_after_checkout( $user_id ) { - pmpromc_pmpro_after_change_membership_level( $_REQUEST['level'], $user_id ); +function pmpromc_pmpro_after_checkout( $user_id, $order ) { + pmpromc_pmpro_after_change_membership_level( $order->membership_id, $user_id ); if ( empty( $_REQUEST['additional_lists'] ) ) { $_REQUEST['additional_lists'] = array(); } pmpromc_set_user_additional_list_meta( $user_id, $_REQUEST['additional_lists'] ); } -add_action( 'pmpro_after_checkout', 'pmpromc_pmpro_after_checkout', 15 ); +add_action( 'pmpro_after_checkout', 'pmpromc_pmpro_after_checkout', 15, 2 ); function pmpromc_log( $entry ) { $options = get_option( 'pmpromc_options' );