Run code after all membership level changes have occured. Users who have had changes will be stored in the global $pmpro_old_user_levels array.

do_action( 'pmpro_after_all_membership_level_changes', $pmpro_old_user_levels_copy );

Here is an example of how to use this hook. Lines 1-13 show how to get the user_id, old levels, and new levels. The rest is an example of the type of array juggling you often need to do based on the levels, but may not be needed.

Parameters

$pmpro_old_user_levels_copy
Array of user_id => array( old_level_objs )

Source

File: https://github.com/strangerstudios/paid-memberships-pro/blob/master/includes/functions.php

View in Source Code