Advertisement
verygoodplugins

Untitled

May 11th, 2020
1,290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. function my_batch_step_memberships( $user_id ) {
  2.  
  3.     $member        = new MeprUser( $user_id );
  4.     $subscriptions = $member->current_and_prior_subscriptions();
  5.     $transactions  = $member->transactions();
  6.  
  7.     // Remove "Member" and "accidental-counsellor-member" tags if the user has no subscriptions and no transactions
  8.  
  9.     if ( empty( $subscriptions ) && empty( $transactions ) ) {
  10.  
  11.         wp_fusion()->user->remove_tags( array( '1273990', '1312711' ), $user_id );
  12.  
  13.     }
  14.  
  15. }
  16.  
  17. add_action( 'wpf_batch_memberpress_memberships', 'my_batch_step_memberships' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement