Advertisement
verygoodplugins

Untitled

Dec 17th, 2019
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. function my_specific_redirect($redirect, $post_id) {
  2.  
  3.     if ( get_post_type( $post_id ) == 'course' ) {
  4.  
  5.         // Now I know this only affects courses
  6.  
  7.         $user_tags = wp_fusion()->user->get_tags();
  8.  
  9.         if ( in_array( 'Premium Member', $user_tags ) ) {
  10.  
  11.             $redirect = 'https://otherurl.com';
  12.  
  13.         } elseif ( in_array( 'Basic Member', $user_tags ) ) {
  14.  
  15.             $redirect = 'https://basic.com';
  16.  
  17.         }
  18.  
  19.  
  20.     }
  21.  
  22.     return $redirect;
  23.  
  24. }
  25.  
  26. add_filter( 'wpf_redirect_url', 'my_specific_redirect', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement