Last active
December 4, 2017 04:40
-
-
Save xnau/7423daa6cc6bb9e6eff76904ff5d0756 to your computer and use it in GitHub Desktop.
Shows how to trigger an automatic unapproval when the account goes past due in Participants Database Member Payments
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 | |
add_action( 'pdbmps-status_change_to_past_due', 'xnau_unapprove_record', 10, 2 ); | |
function xnau_unapprove_record ( $status, $data ) | |
{ | |
// this is so we can access a function in the plugin | |
global $PDb_Member_Payments; | |
// now set the record to not approved (2nd argument) | |
$PDb_Member_Payments->approve_record( $data['id'], false ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet would go in your theme functions file, or you could, by adding a WordPress plugin header, install it as a plugin.