Advertisement
verygoodplugins

Untitled

Nov 14th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. function exclude_completed_course_from_stale( $tags, $user_id ) {
  2.  
  3.     $stale_tag = 'Inactive Customer';
  4.  
  5.     // If the user has the 'Completed a Course' tag, remove the 'Inactive Customer' tag from being applied
  6.     if ( wpf_has_tag( 'Completed a Course', $user_id ) && wpf_has_tag( 'Customer', $user_id ) ) {
  7.         $key = array_search( $stale_tag, $tags );
  8.         if ( $key !== false ) {
  9.             unset( $tags[ $key ] );
  10.         }
  11.     }
  12.  
  13.     return $tags;
  14. }
  15.  
  16. add_filter( 'wpf_apply_tags', 'exclude_completed_course_from_stale', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement