Last active
February 14, 2022 13:23
-
-
Save MaryOJob/8dc3d7b20df14345570388b6b3ac4db5 to your computer and use it in GitHub Desktop.
Change membership level on approval, if member is approved when using the Approvals Add On
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 | |
/** | |
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_change_level_if_approved( $user_id, $level_id ) { | |
pmpro_changeMembershipLevel( 9, $user_id ); // where 9 is the level ID you want them changed to upon approval | |
} | |
add_action( 'pmpro_approvals_after_approve_member', 'my_pmpro_change_level_if_approved', 10, 2 ); |
@createque tested the recipe, still works
@MaryOJob Thanks for confirmation. So, I must check other factors and find issue…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That would be great solution for my case, but unfortunately the code doesn't work - nothing happens after member approval (membership level doesn`t change) :(