Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created February 18, 2022 14:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/c8d6a2636112625e41b19bdefc03205a to your computer and use it in GitHub Desktop.
Save andrewlimaza/c8d6a2636112625e41b19bdefc03205a to your computer and use it in GitHub Desktop.
Delete User on PMPro Approvals Deny. Delete denied user.
<?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