Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function remove_previous_download_tags( $user_id, $tags ) {
- // If Level 2 is applied, remove Level 1
- if ( in_array( 'Level 2', $tags ) ) {
- $remove = array( 'Level 1' );
- wp_fusion()->user->remove_tags( $remove, $user_id );
- }
- // If both Level 2 and Foo were applied at the same time, remove both Level 1 and Bar
- if ( in_array( 'Level 2', $tags ) && in_array( 'Foo', $tags ) ) {
- $remove = array( 'Level 1', 'Bar' );
- wp_fusion()->user->remove_tags( $remove, $user_id );
- }
- }
- add_action( 'wpf_tags_applied', 'remove_previous_download_tags', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement