Skip to content

Instantly share code, notes, and snippets.

@xnau
Last active December 4, 2017 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnau/7423daa6cc6bb9e6eff76904ff5d0756 to your computer and use it in GitHub Desktop.
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
<?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 );
}
@xnau
Copy link
Author

xnau commented Dec 4, 2017

This snippet would go in your theme functions file, or you could, by adding a WordPress plugin header, install it as a plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment