Last active
          July 30, 2020 08:14 
        
      - 
      
- 
        Save max-kk/0c777ec20fb3c95942c3b707cf937e92 to your computer and use it in GitHub Desktop. 
    LRM after_register_action
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | jQuery(document).on('lrm_user_logged_in', function(response, $form, action) { | |
| if ( "register"=== action && response.data.user_id ) { | |
| setTimeout(function() { | |
| $('.lrm-user-modal').click(); | |
| }, 5000); // 5 sec | |
| } | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // IF the user is registered but not logged in (have to enter pass or verify account) | |
| jQuery(document).on('lrm/ajax_response', function(event, response, $form, action) { | |
| if ( "registration" === action && "register_new_user" === response.data.from && response.data.message.indexOf("Your account is still pending approval") > 0 ) { | |
| location.href = "URL"; | |
| } | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | jQuery(document).on('lrm_user_logged_in', function(response, $form, action) { | |
| if ( "register"=== action && response.data.user_id && $(".um-153").length > 0 ) { | |
| // $(".um-153").length > 0 is optionally to check if your form is loaded on the page, like | |
| // DO your ACTION like | |
| my_send_teacher_msg(response.data.user_id); | |
| } | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | jQuery(document).on('lrm_user_logged_in', function(response, $form, action) { | |
| if ( "register"=== action && response.data.user_id ) { | |
| // https://developers.google.com/analytics/devguides/collection/analyticsjs/events | |
| ga('send', 'event', 'user', 'register', "User registration"); | |
| } | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // IF the user is registered but not logged in (have to enter pass or verify account) | |
| jQuery(document).on('lrm/ajax_response', function(event, response, $form, action) { | |
| if ( "registration"=== action && response.data.user_id ) { | |
| setTimeout(function() { | |
| jQuery('.lrm-user-modal').click(); | |
| }, 5000); // 5 sec | |
| } | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment