Advertisement
Guest User

autodropsub

a guest
Aug 5th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2.  
  3. function custom_remove_from_free_subscription( $tosub_id, $tolevel_id, $to_order, $user_id ) {
  4.  
  5.     // check for the subscription id
  6.     if( $tosub_id == 3 ) {
  7.         // It's the one we are interested in
  8.         // Get the member
  9.         $member = new M_Membership( $user_id );
  10.         // Check they are on the free subscription
  11.         if( $member->on_sub( 5 ) ) {
  12.             // Remove the subscription
  13.             $member->drop_subscription( 5 );
  14.         }
  15.  
  16.     }
  17. }
  18.  
  19.  
  20. add_action( 'membership_add_subscription', 'custom_remove_from_free_subscription', 10, 4 ));
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement