Advertisement
Aurangajeb

Dokan vendor redirect with woocommerce_login_redirect

May 13th, 2021
1,011
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement