/** * Function just for handling the membership callback, to interpret the parameters * for the class to take over. * * @param Integer $id The ID if the user being changed. */ public function handle_updateUserCourseAccess($id) { $s2member_access_level = 's2member_level' . get_user_field("s2member_access_level", $id); // Over to the parent class to handle the sync of data. parent::handle_courseSync($id, array($s2member_access_level)); }
/** * Function just for handling the membership callback, to interpret the parameters * for the class to take over. * * @param Integer $id The ID if the user being changed. * @param Array $levels The list of levels for the user. */ public function handle_updateUserCourseAccess($transaction_id) { // Get transaction data $transaction = get_post($transaction_id); // Get customer ID based on transaction ID $customer_id = get_post_meta($transaction->ID, '_edd_payment_user_id', true); // Get all membership levels for customer making current transaction $memberLevels = edd_get_users_purchased_products($customer_id); $userLevels = array(); foreach ($memberLevels as $key => $memberLevel) { $userLevels[$key] = $memberLevel->ID; } // Over to the parent class to handle the sync of data. parent::handle_courseSync($customer_id, $userLevels); }