Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Do something when the status of a member in RCP changes
<?php
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
break;
case 'active' :
break;
}
}
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