Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function set_default_role( $user_id, $role ) {
- $user = get_userdata( $user_id );
- if ( empty( $user->roles ) ) {
- $user->add_role( 'inactive' );
- }
- }
- add_action( 'remove_user_role', 'set_default_role', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement