Skip to content

Instantly share code, notes, and snippets.

@nayemDevs
Last active January 31, 2019 20:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nayemDevs/9eb54de5219453608e1d4c0da9713c21 to your computer and use it in GitHub Desktop.
Save nayemDevs/9eb54de5219453608e1d4c0da9713c21 to your computer and use it in GitHub Desktop.
add_filter('woocommerce_registration_redirect', 'ps_wc_registration_redirect');
function ps_wc_registration_redirect( $redirect_to ) {
if ( is_user_logged_in() ){
$current_user = wp_get_current_user();
if( $current_user->roles[0] == 'seller' ) {
$redirect_to = dokan_get_navigation_url( 'dashboard' );
return $redirect_to;
}
}
return $redirect_to;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment