Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created July 28, 2014 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pippinsplugins/6ef05f7d293cc215a441 to your computer and use it in GitHub Desktop.
Save pippinsplugins/6ef05f7d293cc215a441 to your computer and use it in GitHub Desktop.
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