Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exclude_completed_course_from_stale( $tags, $user_id ) {
- $stale_tag = 'Inactive Customer';
- // If the user has the 'Completed a Course' tag, remove the 'Inactive Customer' tag from being applied
- if ( wpf_has_tag( 'Completed a Course', $user_id ) && wpf_has_tag( 'Customer', $user_id ) ) {
- $key = array_search( $stale_tag, $tags );
- if ( $key !== false ) {
- unset( $tags[ $key ] );
- }
- }
- return $tags;
- }
- add_filter( 'wpf_apply_tags', 'exclude_completed_course_from_stale', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement