Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Do something when the status of a member in RCP changes
function pw_rcp_update_role_status_change( $new_status, $user_id ) {
switch( $new_status ) {
case 'expired' :
case 'pending' :
case 'free' :
case 'cancelled' :
// Put your cancellation code here
case 'active' :
add_action( 'rcp_set_status', 'pw_rcp_update_role_status_change', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment