Created
February 18, 2022 14:31
-
-
Save andrewlimaza/c8d6a2636112625e41b19bdefc03205a to your computer and use it in GitHub Desktop.
Delete User on PMPro Approvals Deny. Delete denied user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Automatically delete user when their approval is denied. | |
* Add this code to your site by following: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_approvals_delete_member_on_deny( $user_id, $level_id ) { | |
wp_delete_user( $user_id ); | |
} | |
add_action( 'pmpro_approvals_after_deny_member', 'pmpro_approvals_delete_member_on_deny', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment