Aurangajeb

Dokan vendor redirect with woocommerce_login_redirect

May 13th, 2021
616
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter( 'woocommerce_login_redirect', 'ckc_login_redirect', 10, 2 );
  2.  
  3. function ckc_login_redirect( $redirect_url, $user ) {
  4.     // Change this to the url to Updates page
  5.  
  6.     if( $user->roles[0] == 'seller' ) {
  7.         return dokan_get_navigation_url(‘dashboard’);  
  8.     }
  9.  
  10. return $redirect_url;
  11. }
RAW Paste Data