Advertisement
verygoodplugins

Untitled

Feb 13th, 2019
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. function wpf_user_login( $user_login, $user ) {
  2.  
  3.     if( ! function_exists( 'wp_fusion' ) {
  4.         return;
  5.     }
  6.  
  7.     $first_login_tags = wp_fusion()->settings->get( 'first_login_apply_tags' );
  8.  
  9.     if( ! empty( $first_login_tags ) ) {
  10.  
  11.         $last_user_login = get_user_meta( $user->ID, 'last_login', true );
  12.        
  13.         if ( empty( $last_user_login ) ) {
  14.             wp_fusion()->user->apply_tags( $first_login_tags, $user->ID );
  15.         }
  16.  
  17.     }
  18.  
  19. }
  20.  
  21. add_action( 'wp_login', 'wpf_user_login', 0, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement