Advertisement
verygoodplugins

Untitled

Apr 29th, 2020
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. function my_wpf_remove_tags( $tags, $user_id ) {
  2.  
  3.     if ( in_array( 'Membership:Active', $tags ) && wp_fusion()->user->has_tag( 'Membership Expired' ) ) {
  4.  
  5.         $key = array_search( 'Membership:Active', $tags );
  6.  
  7.         unset( $tags[ $key ] );
  8.  
  9.     } elseif ( in_array( 'Membership:Active', $tags ) ) {
  10.  
  11.         wp_fusion()->user->apply_tags( array( 'Membership:Inactive' ), $user_id );
  12.  
  13.     }
  14.  
  15.     return $tags;
  16.  
  17. }
  18.  
  19. add_filter( 'wpf_remove_tags', 'my_wpf_remove_tags', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement