verygoodplugins

Untitled

Jan 18th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. function custom_quiz_completed( $data, $user ) {
  2.  
  3.     if ( ! function_exists( 'wp_fusion' ) ) {
  4.         return;
  5.     }
  6.  
  7.     if ( $data['pass'] == false ) {
  8.  
  9.         if ( wp_fusion()->user->has_tag( 'COURSE FAILED - CINV M1' ) ) {
  10.  
  11.             $tag_id = wp_fusion()->user->get_tag_id( 'CINV M1 Attempt 1' );
  12.  
  13.             wp_fusion()->user->apply_tags( array( $tag_id ) );
  14.  
  15.         }
  16.  
  17.     }
  18.  
  19. }
  20.  
  21. add_action( 'learndash_quiz_completed', 'custom_quiz_completed', 3, 2 );
Add Comment
Please, Sign In to add comment