Forked from andrewlimaza/pmpro-approvals-delete-deny.php
Last active
October 29, 2024 11:58
-
-
Save kimwhite/5a11fbeb62d8cee1297c92dc8c378caf to your computer and use it in GitHub Desktop.
Delete User on PMPro Approvals Deny. Delete denied user.
This file contains 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 // do not copy this line. | |
/** | |
* Automatically give user a set level when their approval is denied. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_approvals_change_member_on_deny( $user_id, $level_id ) { | |
// Set the ID of the alternate membership level | |
$alternate_level_id = 1; // Replace with your desired level ID | |
// Assign the user to the alternate membership level | |
pmpro_changeMembershipLevel($alternate_level_id, $user_id); | |
} | |
add_action( 'pmpro_approvals_after_deny_member', 'pmpro_approvals_change_member_on_deny', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment